Forums

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

Issues with two similar rules for creating an issue if link not exists

Simon Brooke February 6, 2018

Hi Atlassians,

 

I am using the Automation plugin for many things and generally it works perfectly, but I have hit a strange situation:

 

Rule 1: A manual rule that raises a Change issue in a ServiceDesk project and links to the triggering issue

This works fine, I use a condition as follows to stop multiple Change items being created:

First value: {{#issue.fields.issuelinks}}{{outwardIssue.fields.summary}}{{/}}

Condition: Does not contain

 Second value: 'AutoCR:'

Rule 2: A state transition rule that does the same Change issue raising as above, using the same compare condition so a Change is NOT created if one exists with that summary term...

THIS DOES NOT WORK

I put an interim comment adding step into the second rule to dump the inward and outward issue link summaries and they do not appear. The data DOES appear if I do the same in the first rule... So the second rule seems to have a different object represented by 'issue'

Things I have tried:

- inward vs outward issue links

- issue vs triggerIssue as the object to check

- Check the JSON via a REST call

 

I cannot work out why these issueLinks don't seem to exist on the issue object in a state transition rule, versus a manual rule...

 

Any help gratefully received!

 

Simon

1 answer

1 accepted

0 votes
Answer accepted
Simon Brooke February 6, 2018

OK,

 

So the answer was to use the 'Related issues condition' and match on the linked issues NOT matching a piece of JQL e.g. project = ServiceDesk and issueType = Change

Much neater than messing with summary pattern matching, although still not sure why that was an issue...

Automation plugin rocks!

Si

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.
February 6, 2018

Hi Simon,

Great to hear you already solved this one yourself! Yeah the related issues condition is much easier for this case.

I think the underlying cause might be that for the issue transitioned rule, we transform the underlying issue event object Jira passes to us (which I'm guessing doesn't contain issue links), however the manual rule, does a lookup of the issue object which would contain the issuelinks.  The related issues condition also does this lookup (via JQL search).

Cheers,
 Andreas

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events