Post Functions/Automation: Clear Fix Version field when Resolution field is a certain value

Jessica Huebner
Contributor
November 15, 2022

Hey Jira Community!

I'd like to clear my Fix Version field after a Resolution has been set to anything other than Done or Fixed. In my current Workflow, when an issue is Closed, a post-function screen pops up, prompting the user to choose a Resolution value. The Resolution value options include the following:

  • Done
  • Fixed
  • Cannot Reproduce
  • Duplicate
  • User Error
  • Won't Do
  • Won't Fix

I'd like a post function (or something else) to automatically clear my Fix Version field, when an issue is Closed, based on the Resolution value. I want to clear the Fix Version field when the Resolution is not Done or Fixed. Right now, my post transition function clears Fix Version regardless of the Resolution value, leading me to believe the post function may not be the appropriate place to try and do this. Any insight would be appreciated!

2 answers

2 accepted

1 vote
Answer accepted
Dawid Joshua _TechTime_
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.
November 15, 2022

You could create a transition and post-function on a Status with a condition to check the value of Resolution. I personally would rather do it with automation, as implementing any advanced logic in Workflows is a nightmare... 

If you haven't used Jira Automation before, have a quick read here.

Then, you can create a new automation that looks like this: Screenshot 2022-11-16 at 09.50.02.png
To describe what it does:

  1. The top step is a trigger listener. For each issue, when the resolution field value changes, trigger this automation
  2. The middle step is a condition. If the current value of Resolution is not Fixed or Done, continue. Otherwise, break out and the Automation doesn't change anything.
  3. And finally, edit the Fix version field. Now, Automation is a bit weird when it comes to clearing values instead of inserting ones. Therefore, you have to write a small bit of JSON in your Edit step:
    Screenshot 2022-11-16 at 09.54.16.png

And you're done. Publish the Rule under a name. Under Rule details, you might want to limit the automation scope to just selected Projects. This time the automation will be triggered only when a ticket in the given project is being resolved. 

 

But be warned: Atlassian limits how many executions you have per month on Cloud, depending on which products you have and on which subscription. To see how many executions you have, navigate to Global automation settings in Jira and then Usage

Screenshot 2022-11-16 at 10.04.25.png

Jessica Huebner
Contributor
November 15, 2022

Thanks so much for the thorough explanation! It makes perfect sense. I'm just struggling to get the rule to execute. Have confirmed it's turned on. Maybe my JSON formatting is the culprit? Here's what I have:

Clear Fix Version.png

Dawid Joshua _TechTime_
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.
November 15, 2022

Hi @Jessica Huebner ,the format looks right. Tested it and it works for me. As @Walter Buggenhout mentioned in his response, you actually don't have to write it. You can just leave it blank. As for why your automation doesn't trigger, please check your Audit log:
Screenshot 2022-11-16 at 10.38.03.png
Could you share what's in there? 

Jessica Huebner
Contributor
November 15, 2022

Thanks. Looks like my rule isn't firing at all. I'll keep fiddling...

Automation.png

Like Craig Nodwell likes this
Jessica Huebner
Contributor
November 15, 2022

Just thinking maybe I have this part set up wrong. I initially had "Value deleted" but then changed it to "Any changes to the field value" but still can't get it to trigger (I have a test ticket I'm closing/reopening):

 

Snag_1bba82df.png

Like Craig Nodwell likes this
Dawid Joshua _TechTime_
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.
November 15, 2022

Usually, the Resolution field gets a value on a transition screen. You might want to remove the Edit issue in the For field to select all Operations.

Like Craig Nodwell likes this
Jessica Huebner
Contributor
November 16, 2022

Thanks, Dawid. Setting the change type to "Value added" and For to "Transition issue" is what did the trick. Thanks for all your help!

Like Craig Nodwell likes this
0 votes
Answer accepted
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 15, 2022

Hi @Jessica Huebner,

An automation rule like this should let you do the trick:

Screenshot 2022-11-15 at 22.03.10.pngLeaving the value for the fix version field blank in the final Edit issue step will clear the field value.

Hope this helps! 

Jessica Huebner
Contributor
November 15, 2022

Thank you! Looks like I might need to write some JSON to clear the field (leaving it blank didn't seem to do the trick for me. Have replied in another thread!

Like Craig Nodwell likes this
Walter Buggenhout
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 15, 2022

Hi @Jessica Huebner,

Just to keep things consistent here and relating to your trigger:

Just thinking maybe I have this part set up wrong. I initially had "Value deleted" but then changed it to "Any changes to the field value" but still can't get it to trigger (I have a test ticket I'm closing/reopening):

This is how I set it up in my scenario and successfully tested this:

Screenshot 2022-11-16 at 07.34.34.png

You mentioned in your question that you are trying to trigger this event while you are closing an issue. That is a transition during which you add a value to the Resolution field.

Like Craig Nodwell likes this
Jessica Huebner
Contributor
November 16, 2022

Worked like a charm! I knew it had something wrong, just couldn't see clearly what. Thank you so much for your help. Really appreciate it :D

Like Craig Nodwell likes this

Suggest an answer

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

Atlassian Community Events