Jira Software automation issues

Sam Roza March 5, 2024

Hello All!

 

I have a small team of folks who work in a Jira instance. We log tasks and do generally low-tech logging (think of it more like task-based cases like a support system). We are working with out tableau folks to automate the logging of some data from our tasks. 

When people open an issue with [Company Name] in the summary field, I need it to use the components field and set it there as well. Alternatively, I think we could use Labels, but some of these names are multiple words and I think that wreaks havoc with the labels field.

When people set a task type (think of something generic like "meeting", or "phone call"), I want the automation to set the category of that type of issue-so maybe it's called "communication" for the above, and the components field should read both "meeting" and "Communication". 

I was easily able to get either of these working, but not together and only with caveats:

For the second situation, when I use the IF/THEN automation to edit the components field, it completely wipes out the existing component and replaces it with the automation. That leads to having to have a single rule for every condition/category combination-but surely there is a way to use automation that doesn't just replace the original component, right?

When I combine these 2 rules and put in an issue with "Company Name X", and Component "meeting", all I get is the company name set in components...so it seems like the rules overlap each other and the editing of components just replaces my components. 

WAY too much writing for my problem, but hopefully someone knows what I'm going through and can direct me to the right place for this.

 

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
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.
March 5, 2024

Hi @Sam Roza -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

I suspect a few things are going on:

  • I wonder about the parsing of values you describe; that might require hard-coded values or looping with branches.  The branch looping would run in parallel and asynchronously and certainly could walk-over field updates.
  • When your rule makes updates to a field, and then it makes more changes, it walks over earlier changes.  To reload the current issue state (after one edit and before another), add the Re-fetch Issue action between.  Better still, try to perform the edits in one step.
  • Things like component (or label) updates can be tricky to not walk-over existing values.  Sometimes it helps to use advanced edit with JSON instead, allowing better control over add / remove actions: https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html

Kind regards,
Bill

Sam Roza March 5, 2024

Bill, thanks for the quick response. 

Yes, I assume one rule is stepping on the other as well. I just didn't expect that would be an issue. 

Here are some screenshots:

This is for rule #2:image.png

"strength" is the category component I was speaking of. I had been hoping I could say make a rule that included all of the children of the category (say Active Success Plan/Quarterly Review/Escalations), as an IF, and then "Add the CATEGORY Strength as a THEN condition.

 

The other automation I'm in need of is a rule that looks in the Summary field for a company name in brackets 
[IBM], for example and also appends the company name to the components field. 

I did that in a separate rule, but as mentioned, that was stepping on the first rule:

image.png

So I'm struggling to get this all in as functional rules that work and accomplish my goals. I'll look at the link you supplied, but any tips for a newb to Jira automation would be appreciated.

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.
March 5, 2024

Thanks for those images, and here are some suggestions:

When using the Issue Created trigger, that can fire so quickly that some issue data may not be available to the rule yet.  The fix / work-around for that is to always add the Re-fetch Issue action immediately after the Issue Created trigger.  This will slow down the rule by reloading the data before proceeding.

Next, with two rules both with the same trigger, they will most likely collide.  Instead I would use one rule with if / else blocks for each section, add the new values with a JSON expression, and then re-fetch the issue before proceeding.  For example, you will need separate if / else blocks to replace your earlier rules

  • if / else condition
    • condition: to test for summary contents (e.g., IBM)
    • action: edit issue with JSON to add the component
    • action: re-fetch issue
  • if / else condition
    • condition: to test for components (e.g., from your Strength / Health rule)
    • action: edit issue with JSON to add the component
    • action: re-fetch issue
  • ...

I gave the incorrect link before, so here is the correct one for the JSON edit for Jira Server / Data Center version, which includes examples for using the "update" and "add" of values syntax:

https://confluence.atlassian.com/automation/advanced-field-editing-using-json-993924663.html

 

Sam Roza March 18, 2024

Bill,

I wanted to circle back and thank you for your input. 

In the end, I basically made a very long if/else automation that set the task and category as components. Frustratingly, I could never just *add* to the components field as the rule deletes the contents. That required I say "IF task type A, then set task type A and category type 1 in field components".

But it works just fine. There are something like 27 IFs and ELSEs.

The company name was able to be extracted from the summary field, so I didn't have to worry about an automation for that. 

I investigated the JSON angle, but we are limited to the standard automations by IT.

 

Like Bill Sheboy likes 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.
March 18, 2024

I am glad to learn you have something working, although 27 if / else blocks may be tricky to maintain.  I recommend regularly checking the audit log for that one to watch for problems.

Like Sam Roza likes this
Sam Roza March 18, 2024

Agreed, it seems potentially problematic. The only other thing I could do is have multiple automations and I was worried they would stomp on each other.

I will keep vigilant watch.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer