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?
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.
*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.
Use Jira Automation plugin, the Lite (free) version should work.
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.
Hope this helps
With Scriptrunner, you can add this custom script post-function on the transition Create:
def user = ComponentAccessor.jiraAuthenticationContext?.getLoggedInUser()
def labelManager = ComponentAccessor.getComponent(LabelManager)
labelManager.addLabel(user,issue.id, "Your label here", false)
I just set this up on our site with "Project automation" (which I think is now just built into Jira?)
For us I wanted a way to add "to-groom" to all new cases. I ended up with
When: Issue created
If: Issue matches JQL "(labels is EMPTY OR (labels != "to-groom" AND labels != "groomed")) AND status != Resolved AND status != Closed"
Then: Edit issue fields: Labels SET "to-groom"
Hi Atlassian community, A few months ago, we offered a sneak peak of the new hierarchy view on the roadmap. Thank you for all the feedback (and excitement) and for helping us shape the direction of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events