Forums

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

JIRA Automation - Link a new issue to a recently created issueKey

perla.miranda
Contributor
February 15, 2022

Hi,

Working on automation. I'm trying to do the below:

  1. Create a new issue for groundwork
  2. Create an X amount of issues (this could be 10) as it depends on another field
  3. The new X amount of issues should be blocked by the groundwork issue.

 

I've got step 1 and 2 done. Need help with #3. Now I just need to block the new issues with the groundwork issue. So what I've done so far - right after I create a groundwork issue, I'm creating a new variable named "groundworkIssueKey" with smartValue {{createdIssue.key}}. Once I create X amount of issues for the task I selected "Linked issues" and then "Blocked by".

Goal: Set Blocked by to issueKey=={{groundworkIssueKey}}

Issue: Have tried {{groundworkIssueKey}} and multiple other things. Nothing works.

 

automation_linked_issue.png

 

2 answers

0 votes
John Funk
Community Champion
September 21, 2022

Hi @perla.miranda  - Did you ever get this to work?

0 votes
Dave Bosman [Realdolmen]
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.
February 16, 2022

Hi @perla.miranda 

Seems like you want to link the new issue to the issue that has triggerd the rule? 

If i understand it correctly you don't need variables. You can just use {{triggerIssue.key}} in your linked issues. 

You can find more info on smart values here

Regards

Dave

perla.miranda
Contributor
February 16, 2022

@Dave Bosman [Realdolmen] No, apologies. I guess I forgot a step. The trigger issue is the parent issue. Once the parent issue is created, the groundwork and all other x tasks are sub tasks of the trigger issue. This can be seen a little on the image attached on the left. The groundwork issue and issue created during the process and I just need to reference it.

Dave Bosman [Realdolmen]
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.
February 17, 2022

Hi @perla.miranda 

Lets see if i understand correct now. 

  1. You create an issue (parent issue)
  2. A sub task needs to be created automatically (groundwork)
  3. Extra sub tasks need to be created automatically with blocked by link to groundwork sub task (depending on data in parent issue)

I hope i understood it correctly now. 

I propose to solve it like this: (i used issue types i had available in my example)

First create a rule that creates the groundwork issue, add a label to it so you can easily recognize it with another automation rule. (i used test in my example)

rule 1.png

Now create a second rule, make sure you check the checkbox "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." in your rule details or it wont work.

Now add a branch and select "parent" in "type of related issues". Add a new action "create issue" and complete it like in my example

rule 2.png

 And this is the result. 

2 subtasks created, P1-8 is the subtask that iss created by the first rule.  P1-9 is created by the second rule result1.png

As you can see in the next screenshot, P1-9 has a linked issue P1-8 with blocked by 

 

result 2.png

Hope this helps

Regards

Dave

Marc Isikoff
Contributor
September 27, 2022

I'm using Jira Service Management and want to create an Epic and Story in another project (Jira), not in JSM.

I keep trying to find a solution but all these solutions are predicated on an issue that was just created and trigger on that.

My automation creates an Epic in a project and I want to create a Story as well in that project and tied to that Epic.

Some of the fields on the Story would refer to the Epic (e.g., to take Epic's Summary and replicate to Story summary and append some text) but some fields on the Story would pull from the original issue in JSM that is being worked.

I can create the Epic in another project - works great

Automation fails to create the story - doesn't work at all.

Currently automation is.

When issue transitions from A to B status...

     If assignee in (A, B, C)

     then create Issue (Epic) in Project X

 

     If assignee in (D, E, F)

    then create Issue (Epic) in Project Y

 

    If assignee in (G,H,I)

    then create Issue (Epic) in Project Z

 

For most recently created Issue

    If Issue Matches JQL

      key = {{createdIssue.key}}

    then create new Story

 

On create new Story - how do I get this to create, and how to I refer to the Epic that was prior created vs the Issue in JSM...e.g., {{issue.assignee}} at this point is Epic or JSM?

Suggest an answer

Log in or Sign up to answer