Related Issue Condition

Bill Schmitz November 14, 2017

I have a rule that is triggered when an issue is created.  Is it possible to use a Related issue condition that checks to see if the current issue contains a “is cloned by” link and if so, the rule will continue?

I can get this to work if I just check that Related Issues are present but was hoping I could narrow the type of linked issues to the 'is cloned by' type.

Thank you, Bill

1 answer

0 votes
andreas
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 14, 2017

Hi Bill,

yes you should be able to do this with a related issues condition and smart-values.

This works for me:

related-cond-linked.png

It depends a bit on how your issue link types are set up.  You may have to replace "clones" with the exact name you see on the issue link on the cloned issue.

Cheers,
  Andreas

Bill Schmitz November 14, 2017

Hi Andreas, Thank you for the suggestion.  I had tried that before and did so again but unfortunately it did not work for me.

The beginning of my rule looks like this.

 

0.png

 

The first condition passes but the audit log shows the linked issue condition did not match.

 

4.png

 

I believe my linked issue condition component looks like yours:

 

1.png

 

In my last test, the rule runs when RKTEST-172 is created (by another rule).  RKTEST-172 has a 'is cloned by' link to RKTEST-171.  This link was created immediately prior by the previous rule.  RKTEST-171 links look like this so a 'clones' link is present:

 

2.png

 

System Issue Linking is configured like this:

 

3.png

 

From what I have here, can you tell why this doesn't work for me?

Thank you, Bill

andreas
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, 2017

Hi Bill,

In your trigger for this rule, did you tick the box 'run this rule immediately' in 'More options' by any chance?

If so, can you try to remove that and try this again?

Jira's events system is a bit of a mess, in the sense that it will send the create issue event, *before* the issue may have been indexed or the issue link has been established properly. So if this rule executes immediately you may be seeing a timing issue where the condition isn't yet true.

The other way to verify this is to:

  • Change the trigger to 'Manual'
  • Then navigate to the issue and execute the rule (via 'More' dropdown, then hit the rule name)

Cheers,

  Andreas

Bill Schmitz November 15, 2017

Andreas,

Thank you for the reply.  I was wondering if this might be a timing issue in JIRA but wasn’t sure in that the following related issue conditions work:

1) If I simply check that Linked Issues Are present

2) If Linked Issues match JQL "Clone on Done" = "Yes" and Status = "Done" and resolved >= -1m

So, only checking for a specific type of linked issue fails.  Actually, if I try and reference any smart values in the JQL it fails.  Maybe that’s a clue.

I do not have the execute immediately flag ticked. I just tried changing the rule to manually executed and unfortunately, the same thing happens…no actions performed despite the existence of the linked issue.

For now, my #2 JQL condition above is a workaround to narrow the scope of determining if the rule should be executed and this should be appropriate 99% of the time.  So, I’ll go with it unless you can think of something else.

Again, I greatly appreciate your time and suggestions with this, Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events