Hi everyone,
I’m setting up an automation rule to automatically link related issues between two projects — a team-managed (MIP) and a company-managed (MPD) project.
Each issue has a label in the format ws:<stream>, for example:
ws:branding
ws:dns
ws:integration
In my rule, I’m iterating over all MIP child issues under an epic, and I want to extract the ws: label from each issue to find its matching MPD issue (with the same label).
Here’s the relevant part of my rule:
Branch: parent = "{{userInputs.mipEpicKey}}"
Create variable:
{{issue.labels.join(",").match("(ws:[^,\\s]+)").first}}
Log:
Found wsLabel={{wsLabel}} on {{issue.key}}
However, in the audit log, the wsLabel variable is always empty:
Found wsLabel: for MIP-123
Found wsLabel: for MIP-234
Found wsLabel: for MIP-345
All these issues definitely have labels, so I’m confident the data is there.
I also tried escaping the colon like this:
{{issue.labels.join(",").match("(ws\\:[^,\\s]+)").first}}
but it still returns nothing.
What I’ve checked
Confirmed {{issue.labels}} returns all labels (it does).
Tried contains("ws:") and that works, but I need the exact match (e.g. ws:branding).
Tried several variants of the regex (ws:.*, ws\\:.*, etc.).
The rule scope includes both projects.
Question
Has anyone successfully used match() in Automation for Jira with labels that include a colon (:)?
If so, what regex syntax or workaround did you use to extract the label value?
The end goal is to use that ws: label in a Lookup Issues JQL, e.g.:
parent = "{{userInputs.mpdEpicKey}}" AND labels in ("{{wsLabel}}")
Any help or examples would be appreciated!
Thanks,
Daphne
Hey Dafny
I tried the below and worked for me, check it out:
Test Rule
Result
Audit log showed:
Labels raw: ws:branding
Matched wsLabel: ws:branding
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.