Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation rules based on links

Jakub Szymanski February 16, 2022

Hi,

I'm trying to setup the automation rules which will be based on few conditions. Main goal is to transition incident ticket to next stage once all of those conditions are met. I used few types of configuration however none of them work as intended.

My first call was to go with:

When: Issue updated -> If: all match -> Issue field condition: field "x" is not empty, Issue field condition: field "y" is not empty, Related issues condition linked issue, blocked by, are present -> Then: trasnition issue to: work in progress

However this formula didn't work as expected, sometimes it was triggered, however most of time don't. I was also trying to use different configuration based on for example When: Issue linked or When: field value change however either of those were working.

Can someone help me please how i can setup the rules based on attached links and updated fields? Many thanks in advance.

 

2 answers

1 accepted

1 vote
Answer accepted
Stefan Salzl
Community Champion
February 16, 2022

Hi @Jakub Szymanski ,

  • Does the rule not even get triggered (no entry in the audit log) or is it not performing the expected action (the transition)? 
  • Could you reproduce the behaviour/determine when the rule triggers and when not?
  • Could the rule be limited to a certain issue type? (that also might be an improvement from performance perspective)
  • What kind of fields are those you are checking?
  • --> maybe you could try to trigger the rule and document it with screenshots (including one of the audit log) for gaining a better insight

 

From my personal point of view I would split the rule as in fact the rule could be triggered by several events (at least it seems so from your conditions).

 

Looking forward to your answer.

Best
Stefan

Jakub Szymanski February 17, 2022

@Stefan SalzlHi Stefan,

Rule is triggered, however most of time it is saying that "no action performed" and "The following issues did not match the condition" which is strange, cause all the fields are present and updated. When there is success of the rule, usually is when i'm updating it once again (so if i put all the fields for the 1st time it's not working) but when i'm updating fields for 2nd time it is working as expected.

Yes, i can add some restriction that rule should working only for incidents, how i can do this?

I need to updated:
Urgency - which is JIRA based field of single choice
Assignee - which is also JIRA based field for assignee in the ticket
Severity TEST - this is being auto calcuated based on impact and urgency which i setup different autoamtion rule which is working as expcted. Severity is calculted based on matrix. This is field that i have made on my own.
Linkin issue - this is standard linking between the isses on the JIRA. There is no matter what i will link, what is matter that i need to use "is blocked by" or "blocks" rule.

I cannot seperate those to several rules as all of those fields have to be update to apply this rule, i don't wnat to have 1 field updated and trigger the rule, i need all of those updated to trggered it. Most important here is the link for new issue.

Do you need more details to help me? Please let me know.

Stefan Salzl
Community Champion
February 17, 2022

Hi @Jakub Szymanski ,

I´ll refer to several parts of your answer in blocks:

most of time it is saying that "no action performed" and "The following issues did not match the condition"

 

Severity TEST - this is being auto calcuated based on impact and urgency which i setup different autoamtion rule which is working as expcted. Severity is calculted based on matrix.

  • To get that right: This field will be filled by another autmation rule that will be triggered if you fill out the field "Urgency"
  • eg. we have Story-A 
    • we insert/choose urgency
    • then another automation rule is triggered
    • this triggered automation rule calculates a value and fills in this value to Story-A (which was the trigger-issue), field "Severity TEST"
  • if this is the case could you please send a screenshot of the rule details (from the automation rule of your original question, not the one that does the calculation)
    • As one of your fields (checked in the condition) is set/updated by another automation rule your rule from your question needs to be allowed to be triggered by another automation rule. I guess that might be the reason why your rule often triggers on the 2nd change

 

Yes, i can add some restriction that rule should working only for incidents, how i can do this?

  • This could be handled by another condition after the trigger that checks for the issue type. The rule would still be triggered by update of any issue tpye but would then at least would stop immediatly after the trigger if the issue type doesn´t match. Otherwise all other checks would be done too. Might only be a small change but I prefer to step out of a rule (if i know the conditions) as early as possible (if the conditions don´t match) to avoid unnecessary processing ;)

 

Uffff....that´s quite a lot to read. Hope it helps. 

Looking forward to your answer.

 

Best
Stefan

Like Filipi Lima likes this
Jakub Szymanski February 17, 2022

@Stefan SalzlMany thanks for your comment, i really appriciate your help.

I hope i did everything fine, here is screenshot from the log, it's marking as success now after i add debuging, but still not working.

1111111.jpg

 

 

  • To get that right: This field will be filled by another autmation rule that will be triggered if you fill out the field "Urgency"
  • eg. we have Story-A 
    • we insert/choose urgency
    • then another automation rule is triggered
    • this triggered automation rule calculates a value and fills in this value to Story-A (which was the trigger-issue), field "Severity TEST"

JS: Yes that is the case, however not quite, it's based on two fields Urgency and Impact. I have even removed Severity from rule instead adding just Urgency and Impact as those are manual choice, and still that didn't work. To be honest i'm suspecting that there is some problem when i'm linking issue, however i'm not sure if that's the case. Screenshot looks like this for this rule:

222.jpg

 

This could be handled by another condition after the trigger that checks for the issue type. The rule would still be triggered by update of any issue tpye but would then at least would stop immediatly after the trigger if the issue type doesn´t match. Otherwise all other checks would be done too. Might only be a small change but I prefer to step out of a rule (if i know the conditions) as early as possible (if the conditions don´t match) to avoid unnecessary processing ;)

JS: Thanks for the hint i will look for that and add it. that might be helpful.

Please let me know what else can i do. And many thanks for all the time you already gave me.

Stefan Salzl
Community Champion
February 17, 2022

Hi @Jakub Szymanski ,

you are welcome. That´s what this community is meant for ;) We are happy to share insights and experience and you know: sharing is caring :)

 

I reproduced this on my site. I figured out that "changing/adding assignee" as well as "linking an issue" obviously don´t update the original issue (or at least don´t trigger the automation rule).

Therefore I would stick to the solution to split the triggers and check vice versa:

  • trigger: when field value changed (see screenshots)
    • check condition of link type
    • check if all required fields are not empty
  • image.png
    • regarding your update of the severity: as this field is updated by another rule you have to allow your transition rule to also be triggered by other rules (this is done in rule details by activating the checkbox --> see screenshot)
    • image.png

 

  • trigger: Issue linked
    • checking the same things (at least if fields are not empty)

 

Hope this helps ;) Please let me know if you have any further questions.

 

Best

Stefan

Like Filipi Lima likes this
Jakub Szymanski February 18, 2022

@Stefan SalzlMany thanks, you truly are great.

However still not working... but now i believe i'm making some mistake with configuration. can you take a look and let me know if that would be correct what i have done? Many thanks in advance.

 

x2.jpg

Like Filipi Lima likes this
Stefan Salzl
Community Champion
February 18, 2022

@Jakub Szymanski 

There is a special trigger for "issue linked". As I got it from your description one of the conditions is the linking of type "Block" --> see screenshot. The "issue linked" trigger could listend to this special event (Parent link will not trigger this). You could check the audit log to analyze whether the rule was triggered and if why wasn´t the action processed. In case the rule still doesn´t work: please also add the screenshot of the audit log from an expected run of the automation rule.

 

image.png

 

Hope this helps and we are coming close to a solution ;)

 

Best
Stefan

Like Filipi Lima likes this
Jakub Szymanski February 18, 2022

@Stefan Salzli hate to say that after all your help, but still not working as it should, however i noticed something strange, can you explain me how exaclty liking rule works? Description says:

Rule executes when an issue is linked to another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B. To access ISSUE-A, use {{destinationIssue}}, and to access the link type, use {{linkType}} (e.g. {{linkType}}

If i want to have that rule applied for the issue that link was added, however ISSUE-A is blocked by ISSUE-B and I add link to the ISSUE-A rule should be extecuted in ISSUE-A right? Maybe that's the reason it still not working? How should i use {{destinationIssue}} rule? I strongly beleive this will solve this finally, but i'm not sure how to use it. Are you aware how to do it?

PS. I cannot even say how much i'm greatful for all your help. Seems like we are close to finalize this.

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
February 18, 2022

@Jakub Szymanski 

Could you please explain in more details what did not work? where does the rule fail? what is the audit log logging? Please add a screenshot of the audit log and and the issue that triggered the rule and also describe the procedure what you did in the issue to trigger the rule.

Best
Stefan 

Like Filipi Lima likes this
Stefan Salzl
Community Champion
February 18, 2022

BTW:
Here is a link the describes the types of linking (inward/outward - source/destination):

https://community.atlassian.com/t5/Jira-questions/Issue-links-what-is-the-meaning-of-quot-inward-quot-and-quot/qaq-p/839095

 

Best
Stefan

Stefan Salzl
Community Champion
February 18, 2022

Hi @Jakub Szymanski ,

I´ve set up a rule that I guess will meet your requirement (see screenshot):

image.png

  • action log was just for analyse and can be left out
  • conditions in the destination branch need to be set according your conditions
  • transition action needs to be added in destination branch after conditions checked
Jakub Szymanski February 22, 2022

Hi @Stefan Salzl 

 That's the correct approach, and adding those almost the same as you did have solved my issue. Many thanks for all the help you gave, that was brilliant i really appreciate your effort.

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
February 22, 2022

Awesome :) It‘s my pleasure ;)

So happy we could get this working.

Like # people like this
0 votes
Matthew Day
Contributor
February 16, 2022

From your automation list, you can select the 3 dots for your rule to export a JSON file for the actual configuration. If you attached or posted that, it may get a better response than trying to summarize. Unfortunately, I can't help with what you're attempting.

Jakub Szymanski February 16, 2022

@Matthew DayHi Matthew, would that help? I'm not sure how this JSON file works.

123444444.jpg

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events