Forums

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

How to write condition for Post-Function custom email

Deleted user July 30, 2018

I am writing post function to send custom email using below condition

post-function only works when JIRA is Project=XYZ AND issue type = Story AND (Epic link = XYZ-691 OR XYZ-1114)

 

Till now, I have no idea yet except the below two lines.

issue.projectObject.key == 'XYZ'
issue.issueType.name == 'Story'

How to do for OR condition?

 

 

2 answers

0 votes
Steven F Behnke
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.
July 31, 2018

This should work -- 

issue.projectObject.key == 'XYZ' &&
issue.issueType.name == 'Story' && (
cfValues['Epic Link']?.key == 'XYZ-691' || cfValues['Epic Link']?.key == 'XYZ-1114'
)

Let me know, if you run into a problem please include the error. 

0 votes
Steven F Behnke
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.
July 31, 2018

What plugin are you using? For the scripting?

Deleted user July 31, 2018
JIRA - 7.1.2
ScriptRunner - 5.3.26

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events