Forums

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

Script runner - conditions in custom email

vincentbz
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 13, 2014

Hi,

I'm using JIRA 6.3.7 and Script Runner 3.0.6.

I would like to create a script that send a custom email when a ticket with a specific label is created.
So, it seems that the "send a custom email" script listener is made for this. But I fail in filling the conditions so that the email is sent only when the label is there.

What is the correct syntax for labels please?

labels in ("mylabel")

 

In this listener, i entered the project key, the action (ticket created), email template and subject.

With this, i don't receive anything, with or without "mylabel" as label in the ticket.
Should I add something?

I previously tried with no condition, it works. I tried with "labels : 'mylabel' " and i received an email for every ticket^^.

 

Thanks smile

Vincent

1 answer

1 vote
Ubisoft
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 13, 2014

Hi Vincent, 

You're entering JQL for your condition, you nee to write it in groovy.

 

Something along the lines of this should work

issue.getLabels().contains('mylabel')

Eric

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events