Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to automate startDate/endDate with Fix Version set ?

Hello !

 

We are working on a environment with : 

  • Jira
  • Jira Automation
  • Jira Plan

I want to create a Roadmap that is easy to use so as soon as a fixVersion is set on an Epic (or an Initiative), I would like to update the Target Start or Target End.

First issue :
Those fields are not available from Automation 

Second issue :
(I decided to choose 2 other date fields)

I failed to compute my start date, it worked for my end date.

Here are my formulas : 

Start Date : {{issue.fixVersions.startDate.min}}
End Date : {{issue.fixVersions.releaseDate.max}}

Do you have any idea why ? 

4 answers

1 accepted

1 vote
Answer accepted

Hi @Pierre VIAU ,


Developer from Automation here.

We currently don't have proper support for advance roadmaps, here's the public issue in our tracker encase we do at a later stage: https://community.atlassian.com/t5/Automation-questions/How-to-automate-startDate-endDate-with-Fix-Version-set/qaq-p/1689148


In terms of accessing fields you can use max and min over a list like fix versions, the thing to note with {{issue.fixVersions}} would be that it's the fixVersions attached to that particular issue, so if one of the dates is failing it could be that the ones attached don't have a startDate since it's optional on fixVersions. You might have to put conditions to ensure they are there before editing the date field.

If you require further help with fixVersions smart value then I suggest reaching out to support here: https://support.atlassian.com/

Screen Shot 2021-05-14 at 4.16.18 pm.png


Screen Shot 2021-05-14 at 4.16.49 pm.png

Darryl Lee Community Leader May 14, 2021

Thanks - good to have an authoritative answer on this!

0 votes

Hello Pierre,

Your second issue is actually of problem of date type conversion.
releaseDate and startDate attributes are not the same type.

This made the trick for me:

Start Date : {{issue.fixVersions.startDate.jiraDate.toDate.min}}
End Date : {{issue.fixVersions.releaseDate.max}}

Many thanks Darryl and Yvan :) 

I will try again to work on my automation soon and be back to you with my solution ! 

For information, I was able to automate the setting that way : 

{
"fields": {
"customfield_12807" : "{{issue.fixVersions.startDate.first}}",
"customfield_12808" : "{{issue.fixVersions.releaseDate.max}}"
}
}

Where the 2 custom fields are Target start and Target end dates, used in our Portfolio :) 

Hi @Pierre VIAU 

Just to confirm, are you certain the following works as you expect?

{{issue.fixVersions.startDate.first}}

Fix Versions is a list field, and so the above smart value will return the startDate of the first item in the list, regardless of the order of the values (or the position of the start date in that list).  My understanding is that list fields do not have a built-in ordering mechanism, so your return value will be whatever order the values are given by Jira.

Best regards,
Bill

0 votes

Hi! So you're using min and max. But I don't think that works with lists, and to be clear, because you can have multiple Fix Versions for an issue, the {{issue.fixVersions}} smart value is a list. And so when you reference startDate or releaseDate, those too are lists.

There's some good documentation about this here: 

https://blog.codebarrel.io/automation-for-jira-smarter-smart-values-9da5598f2bdc

So, to clarify, are you trying to deal with the case where there are multiple fixVersions for an issue? If not, then you should just be able to use:

Start Date : {{issue.fixVersions.startDate.last}}
End Date : {{issue.fixVersions.releaseDate.last}}

(This assumes there's only one Fix Version, or that you want to get the start/release dates of the most recently added Fix Version.) 

If you actually have multiple Fix Versions and you do actually need to determine which date is earliest/oldest, I wonder if there's some kind of complex formula you could use with .isAfter or .isBefore.

Here's a listinng of the functions available to date fields:

https://support.atlassian.com/jira-software-cloud/docs/smart-values-date-and-time-functions/

Darryl Lee Community Leader May 10, 2021

Apologies. I don't work enough with Roadmaps or Epics, so I think I misunderstood your question.

think this previous answer should do the trick:

https://community.atlassian.com/t5/Jira-Software-questions/How-to-use-Automation-to-set-Epic-s-start-amp-end-date-equal-to/qaq-p/1497229

Looks the fields you'll want to set are named End Date and Start Date.

And you might need to format the date you get from fixVersions using jiraDateTime.

Darryl Lee Community Leader May 10, 2021

Ugh, actually I misread that last post I linked to. It was talking about Start Date and Due Date, but neither are linked to Target Start/End. Those do not appear to be accessible via Automation.

On my test Cloud instance, I don't even know where the Start Date field came from. I think it may have been created when I set up project based on the "IT service management" Template.

startdate.png

Under Plan Configuration there appears to be a way to use different fields in Plans. Perhaps that's worth looking at?

Screen Shot 2021-05-10 at 1.00.58 PM.png

There's more details on this here: https://confluence.atlassian.com/advancedroadmapscloud/configure-plan-settings-998650959.html#Configureplansettings-dates

But again, I'm not an expert in Advanced roadmaps, so perhaps somebody else could chime in on what the best practice is here.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

470 views 3 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you