Hi everyone,
I’m looking to create an automation in Jira that automatically updates labels based on the value of the Capability field. Here’s the goal:
"|Capability"
already exists. If it does, remove it.For example:
Data Analytics
, the label |CapabilityDataAnalytics
should be added.Asset/Assetbetrieb
, the label |CapabilityAssetBetrieb
should be added.Its important
This logic should work for the following Capability values:
I’d like to achieve this using Jira Automation, but I’m also open to solutions using the REST API.
Any advice, ideas, or examples would be greatly appreciated! 😊
Hi @Ivan
What have you tried thus far to solve this need?
If you have a rule and it is not working as expected, please post the following for context to help the community offer suggestions:
If you have not started a rule yet, I encourage you to try to do so. Successfully using automation rules requires learning and experimentation. And, the Atlassian Community is a place for people to collaborate and learn. It is not to provide turnkey solutions for specific requests.
To get you started creating your rule, please see this introduction: https://confluence.atlassian.com/automation/get-started-with-jira-automation-993924596.html
Then for your scenario, consider using the match() function with a regular expression to both detect the labels to add and to remove: https://confluence.atlassian.com/automation/jira-smart-values-text-fields-993924863.html#Jirasmartvaluestextfields-matchmatch()
Additionally, if / else condition blocks may help for the differences in behavior for some of the different values.
Finally, one of the examples you describe might not be possible:
If Capability is set to Asset/Assetbetrieb, the label |CapabilityAssetBetrieb should be added.
This shows dynamically changing the capitalization for the label text. This would only be possible if the prefix text (e.g., Asset) is known and never changes.
Kind regards,
Bill
Hey Bill,
I’ve tried several approaches to automate updating labels in Jira based on the Capability field, but so far, I haven’t had much luck. Here’s what I’ve done:
Smart Values:
I worked with smart values in Jira Automation to dynamically create and update labels. I tried removing any existing labels that matched the |Capability
pattern and adding new ones without spaces or special characters.
YAML Code:
I experimented with YAML-like configurations for the automation rules, mapping values from the Capability field to the corresponding labels I wanted.
JQL Filters:
I used JQL in the automation rules to find and remove existing |Capability
labels before trying to add the new ones.
Other Workarounds:
I also tried a bunch of combinations of smart value expressions like .replace()
, .remove()
, and string operations to format the labels correctly, but nothing seems to work as expected.
At this point, I’m stuck and can’t seem to get this working properly in our Jira setup. It feels like this issue might not be solvable with the tools we have here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without seeing the specifics of the rule you are trying to use, it is difficult to know what is not working. This is why I asked to see the rule, step details, and audit log. If you cannot provide those, I recommend working with your Jira Site Admin for assistance.
I recommend starting with a simple rule to incrementally implement this scenario.
Then test with various values of the Capability and Labels fields to test your regular expressions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.