Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation: edit multiple tickets based on other

valeria marcon November 28, 2023

Hello, is it possible to edit the same field in multiple tickets inside an automation?
In particular, I would like to create an automation triggered by specific types of tickets: when these tickets trigger the automation, I would like to modify all other tickets mentioned in the description of the trigger-ticket. Is it possible, and in case how to do that?

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2023

Hi @valeria marcon 

That might be possible.  Such a rule would use a regular expression and the match() function to extract the issue keys from the description field, and then use an advanced branch to iterate over them to perform the edits.

Would you please explain the problem you are trying to solve?  That is, "why do this"?  Knowing that will help the community to offer better suggestions.  Thanks!

Kind regards,
Bill

valeria marcon November 29, 2023

Hi @Bill Sheboy ,

thank you for your suggestion, I would try it.

To explain my needs: we have some tickets regarding internal operations which contain a list of "normal tickets" regarding features or bugs that are going to be processed. 
Whenever a ticket of those is done, I would like to select all the tickets mentioned in its description and change their status automatically, in order to avoid a tedious and error prone operation...

thank you

Antuan Sammak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2023

Hi @valeria marcon 

 

would it be an option for you to link these tickets to the main one instead of just mentioning them in the description field?

valeria marcon November 29, 2023

Hi @Antuan Sammak ,

no it's not so easy because this kind of tickets come from an external tool. It would be an option to link tickets selecting them from the description, but the problem remains quite the same: select tickets from the description...

thank you

Antuan Sammak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2023
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2023

Hi, Valeria.

You noted, "...this kind of tickets come from an external tool."  Would you please explain that further?  Are these still all Jira issues?

What is the format of your description field?  Knowing that will help to suggest how to parse these keys / values out for use.   Perhaps provide an example and explain what / when it can be different.

Thanks!

valeria marcon December 1, 2023

Hi @Bill Sheboy , the tickets are automatically created from a form in which a single user can write "whatever" he likes. Every field of this form is then mapped into a jira issue specific field.

Knowing the form input fields, I'm assuming that all the "real jira tickets" will be mentioned in the description field, together with some other text, for example:
"Some work to do in MYPROJECTKEY-123, MYPROJECTKEY-432", but there's no "fixed rule" except the presence of "MYPROJECTKEY-n°"

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 1, 2023

Thanks for that information.  Then my original suggestion still works: using the text function match() with a regular expression pull out the issue keys, and then iterate over those with an advanced branch to make your updates.

valeria marcon December 5, 2023

Thank you @Bill Sheboy ,

I tried to create a "Branch rule / related issues" using JQL  with a key similar to this {{issue.fields.description.match("MYPROJECT-\d*")}} to extract the issue keys to iterate, but it always give me the same error:

"Error searching for related issues. This is most likely because the following issues don't have a related issue of the type you specified. ".

I also tried create an advanced branching with the same smart value, but it returns me "The provided smart value was unable to be resolved to an object."

I think I'm doing something wrong, but I don't know where....

 

PS: before the branch rule, I put an if condition to test the ticket passes the JQL match condition, and from the log it passes...

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 5, 2023

I suspect there is either a problem with the rule structure or the that specific regular expression.

Please post images of your complete rule, the details of the branch using that regular expression, and the audit log details showing the rule execution.  Those will provide some context to help.

And also, I wonder if you change to add a group if that will help:

{{issue.description.match(".*(MYPROJECT-\d+).*")}}

Does your description contain any newlines or multiple lines of text?  If so, that can cause the mismatch also, and splitting first can help:

{{issue.description.split("\n").match(".*(MYPROJECT-\d+).*")}}
valeria marcon January 4, 2024

Thank you for your help @Bill Sheboy 

I updated the query based on your suggestion and it now works. But: it only works if I use it in "lookup issues" and not in JQL smart branch, because the issues retrieved are not currently linked to the parent one.
So, i'm not able to loop over all the lookup issue to update their fields because if I create a branch over the keys retrieved, i can only update the trigger issue 


Screenshot 2024-01-04 alle 14.19.33.png

I thought than that it wold be useful to update the trigger issue updating the "linked issues" field with the retrieved ones, but it's not possibile because I cannot write any smart value:


Screenshot 2024-01-04 alle 14.26.24.pngI am stuck again...

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2024

Using an advanced branch, the rule should be able to iterate over just the keys found; then within the branch any actions will act on the trigger issue. 

And so to add the links to the trigger issue  you could either add a second advanced branch after the first one...or link the issues at the same time you make the edits to the Note field.

If that does not work, please post an image of your current, complete rule, an image of the audit log details, and describe how the linking is not working.  Thanks!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events