Show all JIRA issues closed after its Internal Deadine date? - jira

We have a custom field called Internal Deadline in our JIRA but how do I find all issues that has already been Closed but has surpassed its deadline?
{
id: "customfield_6524",
name: "Internal Deadline",
custom: true,
orderable: true,
navigable: true,
searchable: true,
clauseNames: [
"cf[6524]",
"Internal Deadline"
],
schema: {
type: "date",
custom: "com.atlassian.jira.plugin.system.customfieldtypes:datepicker",
customId: 6524
}
}
I have no problem in checking where we have missed the deadline now() but I want the historical data too but there is no possibility to chose my Closed status in the JQL:
Trying to put the Resolved date results in this error:
Date value 'Resolved' for field 'Internal Deadline' is invalid.
Valid formats include: 'YYYY/MM/DD', 'YYYY-MM-DD', or a period
format e.g. '-5d', '4w 2d'.
Maybe JIRA has only been designed with the here-and-now date in scope? I had hoped I could monitor the "delivery track record".

You should download Script runner plugin (free), that provides some already implemented functions for JQL querying. Once you have it installed, you just can use this query:
issueFunction in dateCompare("","Internal Deadline < Resolved")
For further reference see the docs for dateCompare here, https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_datecompare

Related

How to search and filter issues on created field by specific date JIRA search API

i am using following URL with post request
https://jira.domain.com/rest/api/2/search
request body
{
"jql": "project = AF AND created='2022/09/06'",
"startAt": 1,
"maxResults": 15,
"fields": [
"summary",
"status",
"assignee",
"project",
"created",
"priority",
"duedate",
"description",
"issuetype"
]
}
i have two issues created at date '2022/09/06'. but it is giving no result
{
"startAt": 0,
"maxResults": 15,
"total": 0,
"issues": []
}
Equal operator may not work because of the hidden "hours" inside the date in your JQL.
You may try something following:
project = AF AND created >= '2022/09/06' AND created < '2022/09/07'
Also, you can use some other advanced JQL operations inside that boundaries:
You can use created > "-1d" for the issues created last day. (If the number is 10, it means created last 10 days)
You can use created >= startOfDay(-1d) for the issues created since yesterday.
Atlassian's Advanced JQL Guide may help you for further information.

Assign multiple issues in Jira using Jenkins

I am trying to move and assign multiple issues from Jira using Jenkins
ticketID= jiraIssueSelector(issueSelector: [$class: 'JqlIssueSelector', jql: 'some JQL queries'])
step([$class: 'JiraIssueUpdateBuilder', jqlSearch: "someJQLqueries", workflowActionName: 'Done'])
jiraAssignIssue idOrKey: ticketID, userName: null, failOnError: false
The first step where I am changing the workflow is working fine. However, I can not change the assignee I am getting the bellow message. Is there a way to use the Jira plugin instead of the Jira plugin step to update a non-custom field?
java.lang.ClassCastException: org.thoughtslive.jenkins.plugins.jira.steps.AssignIssueStep.idOrKey expects class java.lang.String but received class java.util.HashSet
I also tried the following and it is not working:
step([$class: 'IssueFieldUpdateStep', fieldId: 'assignee', fieldValue: 'someUser', issueSelector: [$class: 'JqlIssueSelector', jql: 'some JQL query']])
I found the answer to loop through all the tickets in the jql:
ticketID= jiraIssueSelector(issueSelector: [$class: 'JqlIssueSelector', jql: 'some JQL queries'])
ticketID.each{ ticket ->
jiraAssignIssue idOrKey: ticket, userName: null, failOnError: false
}

How to fetch integrated versions field in jira ticket via REST API?

How to fetch integrated versions field present in Jira ticket via REST API?
Your Integrated Version field is probably a custom field based on project version. The field is identified by its ID (e.g. customfield_10500).
If you use common REST API method to retrieve a Jira issue, you can see the field in the JSON response:
https://jira.domain.com/rest/api/2/issue/TEST-123
"fields": {
...
"customfield_10500": [
{
"self": "https://jira.domain.com/rest/api/2/version/21787",
"id": "21787",
"name": "8.0.3.0",
"archived": false,
"released": false
}
],
...
}
You can limit the request to get only that specific custom field only:
https://jira.domain.com/rest/api/2/issue/TEST-123?fields=customfield_10500
To retrieve all available project versions, you need to retrieve all project versions: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.13/#api/2/project-getProjectVersions
fixVersion is a part of a Jira issue. So for that purposes it's possible to get using get issue rest request.
Here's a reference from atlassian doc: https://docs.atlassian.com/software/jira/docs/api/REST/8.5.13/#api/2/issue-getIssue
To grab only fixVersion field and its data, it will look like:
https://jira_url/rest/api/2/issue/$ISSUE_KEY?fields=fixVersions

Create a Task on TFS With Backdated/History Date

The problem is i want to create a task on my TFS with backdated dates
I didn't find anything on internet Kindly suggest me a way either from GUI or APIs
You can use the rest api with the bypassRules parameter to set the created date to whatever date you need.
bypassRules : Do not enforce the work item type rules on this update
POST https://{instance}/{collection}/{project}/_apis/wit/workitems/$Task?bypassRules=true&api-version=5.0
Sample request body:
[
{
"op": "add",
"path": "/fields/System.CreatedDate",
"value": "2020-06-05T02:28:18.603Z"
}
]
Test in Postman:

Microsoft Graph: Unable to Select ExtensionAttributes when using Delta Query?

I've been using the Microsoft Graph to perform Delta Queries on Users. My requirement is to return the values of ExtensionAttributes (custom properties synced to Azure AD from AD on-prem).
The following request works:
/v1.0/users?$select=extension_8928938292839829832_value
And returns the extension attributes as desired:
"value": [
{
"extension_8928938292839829832_value": "String1",
}
However when trying to use the Delta Query and including extension attributes:
/v1.0/users/delta?$select=extension_8928938292839829832_value
The value returned is just the basic user properties, NOT the requested extension value:
"value": [
{
"deletedDateTime": null,
"accountEnabled": true,
"assignedLicenses": [],
etc, etc, etc
},
I'm not sure if the extension values are exposed in the v1.0 Delta Query.
Anyone have thoughts on how to approach this issue? Grabbing these extension attributes and using the delta query to track changes is vital to my solution.
I'm afraid this isn't supported at the moment. This is listed in the Known Issues:
Delta query
OData context is sometimes returned incorrectly when tracking changes to relationships.
Schema extensions (legacy) are not returned with $select statement, but are returned without $select.
Clients cannot track changes to open extensions or registered schema extensions.

Resources