Create Task if Issue Contains Label

I'm trying to use Automation for JIRA to do the following:

1. If a task is updated:

2. If the task's Status is "Done"

3. If the task contains a label "xyz"

THEN

Create a linked task


Is this possible do a conditional to check if an issue has a specific label? I don't see any references to labels within the Smart Fields. I've tried many combinations including {{issue.labels}}, {{issue.fields.labels}}, and {{issue.label.name}} but it doesn't trigger.

1 answer

1 accepted

1 vote
Andreas Knecht Community Champion Jan 08, 2018

Hi Stephen,

You should be able to simply use our JQL condition for this use case. So your rule would look something like this:

  • Trigger: Issue updated
  • JQL conditoin: status = Done AND labels = xyz
  • Create issue (and set the linked issue field to 'trigger issue')

Hope that helps!

Also just for reference, labels is a multi-value field. To print out a comma separated list of all of them you'd need:

{{#issue.labels}}{{.}}, {{/}}

You can use a 'Log action' to debug this. It will write the value to the rule's audit log.

Cheers,
  Andreas

Thanks, this worked!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

78 views 0 5
Read article

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