Forums

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

Automation rule after creating an issue

Javier Cárdaba January 17, 2021

Hello all,

 

I have the following use case:

  • I periodically receive structured emails from a third party.
  • I have configured JIRA to create an issue for each email received (Epic).
  • After the issue is created, a rule is triggered to "process" the issue --> the main objective is to extract from the email body (stored in the issue description field), the values of different custom fields.

This works like a charm. Now I am trying to go further, and I would like to, based on the value of one of the issue custom fields, to be able to create an issue relationship between the recently created issue (Epic), and a third issue (custom issue type).

Is this possible?

2 answers

1 accepted

0 votes
Answer accepted
Muhammad Ramzan(Atlassian Certified Master)
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 17, 2021

Welcome to Atlassian community. If I understood correctly, you want to create two more issues based on custom field values and associate them with epic.

 

Yes , it is possible, please have a look at attached screenshot. Please feel free to reply back if my assumption is wrong so can help you in better way.

 

 

2021-01-18_0-56-42.png

Javier Cárdaba January 18, 2021

Dear Muhammad, thank you for your reply. Your assumption is not correct (and that's because I haven't explained properly). Let me try again:

  • The issues that I want to relate through creating the relationship already exists, and therefore, no issue need to be created.
  • Issue 1 (Epic) has a custom field X with value "A".
  • Issue 2 (custom issue type) has a custom field Y with value A.
  • Issue 1 (Epic) is the one triggering the automation rule. I this workflow, based on the content of the  custom field X I need to locate the issue 2 (using JQL to target the custom field Y. 
  • For each issue found, new relationship needs to be created.

Does it make more sense now?

 

Thanks

Muhammad Ramzan(Atlassian Certified Master)
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 18, 2021

 

I see, now its clear to me. Thanks for the clarification. 

 

So you can't achieve it by above way.  Here is new way. Please have a look at attached screenshot.

What I did, I saved the triggering issue(epic) value in a variable and used that value to execute the JQL then linked the resulting issues with the triggered issue.

 

Hope it will be helpful.2021-01-18_15-43-07.png

Like # people like this
Javier Cárdaba January 19, 2021

Dear Muhammad,

I have arrived to the solution you have summarized in your feedback, so... THANK YOU! 

Like # people like this
1 vote
Daniel Ebers
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 18, 2021

Hi @Javier Cárdaba

adding to the great visualization of Muhammad I wanted to add a link to an Automation video which could be of help:

From what I seem to have understood you also want to link the issue as soon as created.

Could you please check it is what you meant and let us know if you succeeded?
If not, please share what you have.

Regards,
Daniel

Darryl Lee
Community Champion
January 18, 2021

I think the only problem is here:

  • After the issue is created, a rule is triggered to "process" the issue --> the main objective is to extract from the email body (stored in the issue description field), the values of different custom fields.

So the trigger is create, and then he'll need to Edit fields based on match values.

I'm worried that the because Automation actions can fire asynchronously, that any check for a field value may happen before the field is set by the Edit action. (Even if it is laid out in the proper order.)

BUT. I think there's a solution. You set up that first rule above to parse and edit the custom fields upon issue creation.

Then you would set up a second rule whose trigger is: "Field value changed", and have it trigger when the field is Changed. And then (this is the important part), you need to Allow rule trigger:

Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.

This will allow the edits to happen, and THEN, when the fields are set, that will trigger the second rule, where you can create the related issues (or link them, whatever.)

Suggest an answer

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

Atlassian Community Events