Jira automation edit field fix version based on custom field value

Meytal BM
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 Leaders.
May 20, 2021

Hi all, this is what i am trying to do:
When an issue is created and the customer field "Planned version" is not empty (meaning it was filled in with the selected Version), then update the same issue's FixVersion field with the value of the "Planned version" field. Both of these fields are taking the value from "Releases", so it should not be an issue.
I don't get any errors, but it is NOT updating the "Fix version" field upon creating a new issue, in which i selected a "Planned version".
What am i doing wrong?
Thanks

Screenshot (2).png

3 answers

3 accepted

2 votes
Answer accepted
Meytal BM
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 Leaders.
May 20, 2021

@Nic Brough -Adaptavist- @Callum Carlile _Automation Consultants_  it worked! THANK YOU BOTH!

I did a refresh on the page and I saw that the automation worked. I guess once the issue is created, the automation runs and there is probably a few seconds glitch.

Here is what i have done.Screenshot (10).pngScreenshot (9).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 Leaders.
May 20, 2021

Ah, yes, Automation is asynchrnous - it usually happens after a change, so you often need a refresh to get the updated view!

Well spotted!  I always forget that!

Like # people like this
Bill Sheboy
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 Leaders.
May 20, 2021

Hi @Meytal BM 

When the Issue Created trigger is used, there is a chance of a timing problem where all of the data is not yet available to the rule.  The symptom you will see is conditions after the trigger fail to find what you expect.  This is a known REST API defect that Atlassian is working on.  (We have an open support ticket for it.)

The work-around I use is to *always* put a Re-fetch action immediately after the Created Issue trigger.  That will slow down the rule and reload the data before proceeding.

Best regards,

Bill

Like Meytal BM likes this
Meytal BM
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 Leaders.
May 24, 2021

Thanks @Bill Sheboy . What is a Re-fetch. how do i do that?

Bill Sheboy
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 Leaders.
May 24, 2021

Hi!

A re-fetch is an action which reloads the latest state of the issue/issues selected by the trigger.

  • Immediately after your trigger, there should be space to select Add Component
  • Then select New Action
  • And select Re-fetch Issue Data

https://support.atlassian.com/jira-software-cloud/docs/automation-actions/#Automationactions-Re-fetchissuedata

0 votes
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 Leaders.
May 20, 2021

What type of field is "planned version"? 

Meytal BM
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 Leaders.
May 20, 2021

@Nic Brough -Adaptavist- Version Picker (single version) 

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 Leaders.
May 20, 2021

Ok, that might be the problem - most automations can only copy between fields that hold the same content.  Fix version holds a list of version objects, but I think the version picker holds just a version object, with no containing list.  I don't know how (or if) you can convert from a single version to the list.

Meytal BM
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 Leaders.
May 20, 2021

Thanks @Nic Brough -Adaptavist- .

In the case, i created a new custom field as Version Picker (multiple version).

It still doesnt update. wdyt?

Screenshot (6).pngScreenshot (5).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 Leaders.
May 20, 2021

I can't see any reason why that would fail.  I'm sorry, I'm stuck now, we'll need to ask someone who knows field handling in Automation better than me.

Like Meytal BM likes this
Meytal BM
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 Leaders.
May 20, 2021

@Nic Brough -Adaptavist-  i appreciate it. I am also mind boggled by this. Look at the changes I have made that @Callum Carlile _Automation Consultants_  ( see above) suggested and yet it is still not working.

0 votes
Answer accepted
Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2021

Hi @Meytal BM 

You can use the smart value {{issue.Planned version}} or {{issue.customfield_11878}} to set the Fix version field - and for the rule to run successfully, there will need to be a Fix Version with the exact same matching text as the Planned version.

Hope this helps!

Meytal BM
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 Leaders.
May 20, 2021

Thanks @Callum Carlile _Automation Consultants_ for the quick response.

I updated the automation and it still doesn't work.

Please see the images and let me know if these are correct.

Is the condition and action correct?

Are the values correct?

You can see the result of the issue view that also i added the Planned version, it did not add Fix version. And yes, their values come from Version, so there should not be an issue regarding values.

thanks

 

Screenshot (3).pngScreenshot (4).png

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2021

@Meytal BM If you click into your Audit log, what does it say? Does the rule run successfully or are there any failures?

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2021

@Meytal BM Another thing to try:

On the action for editing the Fix Version, click on the 3 dots to the right of the field, then click Copy From. In the fields available, you should be able to select under the 'Field to copy value from' your Planned Version field.

Also, you won't need the JSON in the Additional Fields section as well as the above config

Meytal BM
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 Leaders.
May 20, 2021

@Callum Carlile _Automation Consultants_  I did that, but still doesn't copy that value over.

Note that i created a new Planned version custom field that is multi-versions, which is the same as Fix versions.

Have a look at the screenshot.

Screenshot (8).png

Suggest an answer

Log in or Sign up to answer