Hello fellow Atlassian-ers :)
We have a custom field called 'Closing Category', a field called 'Test Phase' and a third field called 'Root Cause' for a bug issue type.
I've been asked to automate the 'Closing Category' which requires a conditional update based on "Root Cause" field as below,
Please share more context for community to help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Vishal Biyani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please implement these steps and share your automation rule screen shot if you face hurdle.
1. Trigger
Add Issue Transitioned trigger
2. Click on Add Action and search for Add If condition
if issue type equals Bug
3. Add Lookup Table
Click on Add an Action and search for lookup table
4. Click on Add Action and search for Add if block
In Conditions add
Field = Test Phase
Equals User Acceptance Testing
or
Field = Test Phase
Equals Production
5. Click on Add Action and search for Create Variable
Name the variable say RootCause and in smart value put
{{ ClosingCategory.get(issue.Root Cause) }}
5. Click on Add Action and search for Edit issue
In Choose field select Closing Category
and in the text box below put {{ RootCause }}
Let me know if this works for you.
When the transition happens, then you should see Closing Category updated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the above is correct for step 2. What do I need to do at this stage please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Assume you have added Trigger. This is how it would look
Click on + Add Component and on right side you will see a screen like this
Click on IF: Add a condition
Then you will see a screen like this
select Issue fields condition highligted
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I've done step 2. And am now looking at step 3. But unsure what to do for the key and value table entries.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Variables need to be without spaces i.e. one word. So it should be ClosingCategory
in key enter enter Cutover and in value add Production Deployment / Cutover Issue
then click on + Add Entry to add remianing 5 values
Key | Value |
Cutover | Production Deployment / Cutover Issue |
Duplicate | Invalid |
Existing Production | Existing Production issue |
Invalid Defect | Invalid |
Non Reproducible | Cannot be tested, no clear recreation, speculative fix |
Requirements/Specification | Requirements change raised in pilot or rollout} |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much for your help so far @Vishal Biyani
This is what I've set up. However, when I've tested it out by creating a bug with the relevant field options set as follows:
Root cause = cutover
Test phase = production
However the rule is not running according to the audit log and the Closing Category remains as 'none'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share the audit log to understand where the rule is not hitting? Audit log is right besides Rule Details
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in the rule you have missed starting and ending curly braces
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've updated it as per attached. And re-tested the rule, but it's still not 'firing'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you share the trigger for your rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you need to execute this transition on a bug that has Status Fixed to Closed. then only automation will get triggered.
The bug SS that you shared is already in Done status. So in this case the automation will not get triggered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I realised it wasn't triggering the rule as I've used the wrong transition. This is now corrected to be Retest to Closed.
So the audit log is showing 'success'.
However, the Closing Category is still blank/none
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is good progress.
Can you expand the audit logs to understand where the issue is not meeting the condition?
Do validate that your case matches. Otherwise, string comparison may not work and hence field is not getting set.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your patience with me :)
Here's the audit expansion. In the meantime I'll validate my case matches.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looks like Root Cause variable is not getting value. Add more log statements to check where the conditions are failing and go from there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you clarify what you mean by "Add more log statements to check where the conditions are failing and go from there" please Vishal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So wherever smart values are being created, enclose them in {{#debug}} {{/}
for example, for RootCause
{{#debug}} {{ ClosingCategory.get(issue.Helper Issue Creation) }} {{/}
When automation is executed and value is not getting set you know the problem
BTW, WHY are you using Helper Issue Creation, you need to give your custom field name. What i gave you was an example that i created based on available fields in my instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't used Helper Issue Creation ?
I've tried adding the debug here but am getting an error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add one more } at the end.
{{#debug}} {{ ClosingCategory.get(issue.Helper Issue Creation) }} {{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. That's now worked.
This is the latest audit log, with the debug added.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Log shows you are getting Cutover as the value, so you are not using lookup table, while creating the RootCause variable.
Can you revisit your rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Table is fine. Check and share what you have in RootCause? it should be using the lookup table
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it should be like this
{{#debug}} {{ ClosingCategory.get(issue.customfield_19832) }} {{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've updated it
And re-run the automation with a new test bug issue. But the Closing Category is still not populating.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share the SS of the last step i.e edit issue Field?
Also, share the history of what Updates happened after the automation was run
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The only update since last running the automation was updating to this :
{{#debug}} {{ ClosingCategory.get(issue.customfield_19832) }} {{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you see the log message, RootCause is not getting value.
Add debug statement for issue.customfield_19832 to see what value it is having
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already have that in place for the variable. Do I also need to add it for the Edit issue fields?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
add a log statement specifically for issue.customfield_19832
Need to see what else needs to be added to this variable to ensure it is picking right value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.