Forums

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

Condition for JMWE linked item

Henrique Degan
Contributor
October 19, 2023

Hey guys:

I have the following problem:

Am I doing an action in JMWE, which requires a condition?

If there is a linked item of type XX then OK.

I tried a few ways but nothing worked:

{{ linkedIssue.fields.issuelinks.includes ("XX") }} "It was not"

{{ linkedIssue.fields.issuelinks.name == ("XX") }} "It wasn't"

Can anyone here help me?

Thanks in advance

2 answers

2 accepted

2 votes
Answer accepted
David Fischer
Community Champion
October 19, 2023

Hi @Henrique Degan 

If I understood correctly, you're using a JMWE post function and you need it to do its work only if there is an issue linked to the current issue that is of type XX. So XX is the issue type of the linked issue, not the type of issue link that links both issues. Is that correct?

Henrique Degan
Contributor
October 20, 2023

Hello, thank you very much for your feedback!

So that's right, I'm making a Pos Function where a condition exists:

Trigger: When an Item is linked.
Pos function: Add a label
Condition: When the link type is: VAL

 

 

 

LINK12.png

 

LINK1.png

0 votes
Answer accepted
David Fischer
Community Champion
October 20, 2023

Hi @Henrique Degan 

In that case, you're trying to test the link type of the issue link being added, not of any existing issue link. The link being added is available through the context.issueLink variable, as documented on the event based actions documentation. However, only the issue link type is available, not the issue link direction. For example, the "Clones" issue link type has two issue link directions: "clones" and "is cloned by". And users select a link direction, not a link type, in the "link issue" dialog box. So you'll need to figure out what the link type name is on the "Issue Linking" Jira admin page. Then you'll be able to use a condition like:

{{ context.issueLink.issueLinkType.name == "Clones" }}
Henrique Degan
Contributor
October 20, 2023

Hello, thank you very much for your feedback.

I also tried Context but still nothing:

 

LINK4.png LINK3.png

David Fischer
Community Champion
October 20, 2023

Unfortunately, you cannot "test" the condition in the post function editor, as the context is empty (you are not currently linking an issue). You need to test it by saving the event based actions and linking issues together

Like • Henrique Degan likes this
Henrique Degan
Contributor
October 20, 2023

Hello, I understand.

I'll test it here and get back to you soon.

Henrique Degan
Contributor
October 20, 2023

Hello,

I carried out the tests here and it was ok, you are a legend, thank you very much!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events