I have an automation which runs when there is a new comment.
I would like to check if there is a linked ticket prior to running there rest of the automation. I have tried to utilize regex via smart values. {{comment.body.match("(MAR-/d+)")}}. This works to create a linked issue later in the automation. Though I either cant get the format to run properly, or im not appropriately addressing it as Boolean
What I have tried:
Do you mean you are looking for mentions / references to other issues in the comment, or to linked issues? If linked, please see Jack's answer.
If you want mentions / references...
The match() function returns matching values, not true or false: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--
To do what you ask check if the result is not empty instead of "true".
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am looking to see if there are any mentions/reference to a ticket (CTRL+k then type a ticket number in the comment text box) in the trigger comment. Then setting that as a linked ticket. I am doing this as it is reporting errors every time when someone posts a comment without an issue key in the comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for clarifying, James.
You may then want to consider using match() to extract the zero-to-many matches, using them to feed the linking...either in a single JSON update or using an advanced branch to walk them.
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.
@Jack Brickey @Bill Sheboy I also found this just now. https://www.atlassian.com/software/jira/automation-template-library#/rule/112175/12212096
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and I believe that example rule from the library works for one mention, not multiple. Have you tried it with multiple mentions?
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.
I am glad to hear that, and a bit puzzled...
It seems there is even more variability than I suspected in the automation rule actions as Link Issue appears able to take a single value or a collection...which is undocumented behavior.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guys, that link didn't take me to a specific rule in the library . Can you elaborate on the actual rule?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try scrolling 3/4 of the way down the page? I think someone on the UX team should make a required update that the library results take you to the top of the page, or links change as a user scrolls on page to different anchors. Either way... Here is a screenshot of the rule. I think what was happening is I wasnt addressing the results of the match properly. I haven't worked with regex in a minute, and it was difficult to find documentation with a few examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, @Jack Brickey
FYI that I sometimes find the automation rule library "glitches" and is unavailable for a period of time, leading to an empty page with just library heading. It often reappears a few hours later. This seems to happen regardless of the browser used.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi @James_Gigantes , if you're simply wanting to check if a link exist before proceeding further into the automation rule you can use the advance compare condition. Here is an example...
So that you don't have to retype here is the Smart value text...
{{#issue.fields.issuelinks}}{{id}}{{/issue.fields.issuelinks}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please see my reply to Bill above. I am looking to see if there are any mentions/reference (CTRL+k then type a ticket number in the comment text box) in the trigger comment. Then setting that as a linked ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes i saw that. i see you accepted Bill's answer so assume his recommendations worked for you?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.