Forums

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

Automatically assign future sprint to issue, based on issue Start and Due date

Daniel Dimitrov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2023

Hi,

I'm attempting to automatically assign future sprints to tasks, based on the sprint start/end date and issue start/due date. My current flow has been:

trigger on issue due date change

send web request to fetch all sprints from the board

new branch for each smart value {{Sprint}}

if statements with {{issue.customfield_10015.isAfter(sprint.StartDate)}} equals True and {{issue.DueDate.isBefore(Sprint.DueDate)}} equals True then edit sprint field of issue with Sprint.ID.

When running this automation the triggered issue is always not update due to not passing the if statements. I logged separately issue/sprint information to be sure that the data is access properly and all is fine, but I think the problem comes from the different date/time format of the fields. In example Sprint dates are in format 2023-01-29T22:19:00.000Z with issue Due/Start date being 2023-01-24, which prevents .isBefore/isAfter checks to work.

Is there need of any type of conversion of values before comparing them to make this flow work or usage of specific comparison approach when working with system and custom date fields?

 

1 answer

1 vote
Callum Carlile _Automation Consultants_
Community Champion
January 24, 2023

Hi @Daniel Dimitrov , welcome to the Atlassian Community!

If you check out this link, you are able to use these formats to change the date/time values that your smart value returns.

These smart values can be used to format any date values, such as {{issue.Due Date.jiraDate}} will return only the date. So perhaps if you try this on your sprint date, then it will be able to compare the two dates

Daniel Dimitrov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 28, 2023

Hi @Callum Carlile _Automation Consultants_ ,

I played with that however something is still not right. So I've logged the exact conditions for comparison, to see when the spring information will return True for both checks

Screen 1.png

 

however the actual check, which uses the same type of values is not working, since the automation still says:

Screen 3.png

below is the exact setup in the automation, for which I also tried advanced comparison with true or True (in case it is case-sensitive)

screen 4.png

David Yohler August 18, 2023

I attempted to do something similar.  I did discover that the Sprint won't actually iterate through the futureSprints, rather it is reading the Sprint value (if any) from the issue in question.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events