Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Automation: Sprint start dates returned from Web Request not recognized as dates

Greg McNamara
October 10, 2023

Hi,

I'm using the Web Request component in Jira Automation to return a list of sprints for a specified board. I want to find the future sprint with the closest date to now.

The Web Request url is https://{{instance}}.atlassian.net/rest/agile/1.0/board/{{boardId}}/sprint?state=future

The Web Request returns the following body:

{
"maxResults": 50,
"startAt": 0,
"isLast": true,
"values": [
{
"id": 2,
"self": "https://[instance].atlassian.net/rest/agile/1.0/sprint/2",
"state": "future",
"name": "Sprint 2",
"startDate": "2023-10-26T11:00:00.000Z",
"endDate": "2023-11-02T11:00:00.000Z",
"createdDate": "2023-10-02T23:14:15.261Z",
"originBoardId": 1
},
{
"id": 3,
"self": "https://[instance].atlassian.net/rest/agile/1.0/sprint/3",
"state": "future",
"name": "Sprint 3",
"startDate": "2023-11-02T11:00:00.000Z",
"endDate": "2023-11-09T11:00:00.000Z",
"createdDate": "2023-10-02T23:14:19.908Z",
"originBoardId": 1
}
]
}

Note: the sprint id and name values above have been simulated. It won't be possible to determine the next sprint from the id or name, so startDate would need to be used.

I'd like to get the id of the sprint with the earliest future start date. If I first try to get the earliest date using the smart value {{webResponse.body.values.startDate.min}} it returns an empty string/value. {{webResponse.body.values.startDate}} returns the 2 start dates as text values. I think the problem is that the smart value doesn't recognize the date in the format returned by the Web Request so it can't use the min/max functions. I have tried converting the date text values to the Jira default format using {{webResponse.body.values.startDate.left(21).concat("+0000")}} but this still won't return a min/max.

Any ideas on how I can get the earliest sprint start date from this web response?

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 17, 2018

Your proxy says

/ http://domain.com:8081

So that should make it available on 

 https://jira.A.domain.com

Karim Ennassiri
October 17, 2018

Should I change it to https://jira.A.domain.com ?

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 17, 2018

Change what?  The url you are using in the browser, yes.  Not the proxy.

Karim Ennassiri
October 17, 2018

It is ok now, but i have a new problem of dashbord display ? 

Capture du 2018-10-17 23-49-13.png

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 17, 2018

You've missed the instructions about amending the server.xml in the docs.  See https://confluence.atlassian.com/adminjiraserver071/integrating-jira-with-apache-using-ssl-802593043.html 

Karim Ennassiri
October 18, 2018

Thanks !

Suggest an answer

Log in or Sign up to answer