Is there a way to automatically add a Label for a created JIRA issue?

I've setup a Zapier integration so that any new alerts in PagerDuty will create a new issue in JIRA for our Ops team to see.

Is there any way to automatically add a Label to these newly created JIRA issues? So the workflow might look like:

PagerDuty alert > new JIRA issue created > the "PD-Alert" Label is automatically added to the JIRA issue

Is this possible at all?

5 answers

Solved this without expensive plugins for Jira enterprise V7.4.2:

1 Edit the workflow->"create transition" to add a post function to the create step. 

2 (for some reason you cant edit label as a field directly) so add your label-name to a tmp custom field that is a text string.

3 add another post function that copied this field to the labels field

4 clear the tmp custom field value.

Hi Johnson,

JIRA does not have a built-in feature for that, but I believe you should be able to achieve this with a custom script using the Script Runner plugin.

I've found a script to add labels automatically. Maybe you can customize that script.

https://answers.atlassian.com/questions/56290/auto-assign-labels-based-on-the-user-group

Hope this helps

@Rodrigo Sogari [Atlassian] Thanks for the very quick reply – much appreciated.

Script Runner looks promising but it does not run on Cloud instances. Bummer. Do you have any other suggestions?

@Rodrigo Sogari [Atlassian] HI

How to add 'Labels' automatically on Transition/State change ( i.e  changing the bug status (Ex) to 'Open' to 'close' state.Does JIRA support for this.

Please Comment.
Thanks 

0 vote

*This is a fix for Jira Service Desk*

I was able to solve this with a simple non workflow related workaround

Project Settings -> Request types- >Edit the request you want to add labels to -> Add  a "Hidden" labels field with the label you need in "Preset value". This will ensure that when the issue is created, the label automatically gets added to a issue of that type.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,321 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot