Forums

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

How do you trigger scriptunner scripts via listener and expression when linking issues?

Teodor Hoza
Contributor
April 15, 2022

Case: 

Issue 1 from project A and issue 2 from project B

I created a script listener on on project A with Issue link created trigger. (script does not matter in this case)

When linking an issue 2 to issue 1 with link type issue 2 "causes" issue 1 the script triggers, all good here, but when I try adding a condition which tries to filter the link based on direction and project key, the script no longer triggers.
Here's a list of conditions I tried to use (they are valid conditions).

1. issue.links.filter(L => L.type.inward.includes("is caused by") && L.inwardIssue.key.match('^(A)')).length > 0

2. issue.changelogs[0].items.filter(L => L.field == "Link" && L.toString.includes("This issue is caused by A")) != null

Note, I also tried working around this by using Issue Updated and Issue Updated + Link created.

I am running out if ideas, please help

0 answers

Suggest an answer

Log in or Sign up to answer