Can 1 subtask be automatically blocked by 2 other subtasks in the same chain?

Quinn Campbell October 25, 2023

I currently have a series of subtasks triggered by an event. There are 2 chains of tasks that each chain link is dependant on the previous task being completed before the next can be started. I have this happening by the top subtask of each chain not being linked, but each next subsquent task having a linked issue that is blocked by most recently created issue. I have a subtask that will also need to be completed once both chains of subtasks are finished, is there a way to have that task reference not only the "most recently created issue" which is the task just above, but also a task listed 5 above (the end of the other chain)?

2 answers

1 accepted

0 votes
Answer accepted
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.
October 28, 2023

Hi @Quinn Campbell 

From some of the information in your question, I am assuming you are working on an automation rule.

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...My guess would be "maybe", depending upon the structure of your rule.

Let's assume your rule is creating those subtasks, one-by-one, with no branching or if/else structures in the rule.  In that case, you could refer to a specific created issue using the get() function, such as {{createdIssues.get(3)}} to refer to the fourth created issue, as the get uses a zero-based count.

If that is not the case, perhaps you could save the key of a created issue using the Create Variable action, for later use in the rule.

Posting an image of your rule will help to confirm what might help.

Kind regards,
Bill

Quinn Campbell October 30, 2023

@Bill Sheboy 

2023-10-30 15_01_39-Battery Production (test) - Details - Jira.png

Gotcha, will always try and include a picture. Totally understand how that might help.

 

Ok so here is sample rule that I'm talking about, very straight forward trigger happens -> 6 subtasks with details are created. 

Now theres several "chains of task"

1 & 2 are related, 2 is linked and blocked by 1. Linked issue "is blocked by most recently created issue. " that works just fine, 

3 is its own issue, not blocked by anything

4 is blocked by both 2 and 3, but I can only see how to make it blocked by 3, same as the rule applied to 1&2, linked and blocked by most recently created issue. **

5 is blocked by 4, works fine, same as the 1&2 rule.

6 is blocked by 5, but also a subtask in a completely different automation that is trigger by the same trigger. **

 

So my questions is where my **'s are, how can I have a linked issue to another subtask created either inside the same automation or outside?

You mentioned "you could refer to a specific created issue using the get() function, such as {{createdIssues.get(3)}} to refer to the fourth created issue, as the get uses a zero-based count." but in the linked issue field I only see the ability to use "Most recently created issue/trigger issue". Where would I be using this get() function?

 

And for your suggestion of using a saved key as a variable, can you expound on that? Are you saying create a custom variable that is then assigned with copy value of key (insert proper syntax here), that a rule further down calls to, to say it blocks or is blocke by?

 

Thanks for the help!

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.
October 30, 2023

Please let me know if I miss any of the questions you asked...

When creating (or editing) an issue, you may often type in a smart value expression.  Type in (or paste in) the smart value, and it will appear below the field.  You may then select it to use it.

For your scenario of adding 6 issues, you want to add several links.  For the links on the already created issues, you can use {{createdIssues.get(someNumber)}} to refer to that issue's key, where someNumber is that 0-based method for the get() function of lists.

For example, you are creating issue #4, and linking to #2 and #3.  The values to use would be: {{createdIssues.get(1)}} and {{createdIssues.get(2)}} respectively.

This is easier than the other method I noted: created variables.  A created variable can store something which may be used later in a rule...in many cases.  There are some limitations, so the earlier method I note works well for your case.  The created variable would be better if you were doing if/else conditions, etc.

 

You also note wanting to link one of your six to "a subtask in a completely different automation that is trigger by the same trigger".  That is not possible inside of this rule, as it cannot "see" that other rule's information.

I believe a viable alternative is to combine the rules so the subtasks are visible to each other at their create time.  Otherwise there is no guarantee when both subtasks will exist in order to link them.

Quinn Campbell October 31, 2023

So I was going to say that there were only 2 options trigger issue or mostly recently created issue, but for those who are new to this whole thing, know you can just start typing in that box and it will accept other entries. Its not entirely obvious. 

 

That being said, a very noob question.... How do I properly use "and" to reference both issues?

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.
October 31, 2023

Sorry, what I meant was that would be 2 different links added.  And so each smart value is used separately.

And I agree: that ability to enter and select a smart value for some rule components is not in the documentation.  I only found it by experimenting.  

Quinn Campbell October 31, 2023

where do I assign the second link? I dont see a way to have a second linked isssued field, would that be something I add in the additional feilds portion?

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.
October 31, 2023

Oops, sorry: I forgot that the Create Issue action only supports adding one link at create time (due to a limitation in the REST API function).

The work-around is to add one of your links with create, followed immediately by:

  • branch: to most recently created issue
    • action: edit issue to add the other link
Quinn Campbell October 31, 2023

Eureka!!! That worked. For anyone else that comes behind please look below at pictures of the 3 steps for setting that up.

step 3.pngstep 2.pngStep 1.png

Like Bill Sheboy likes this
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.
October 31, 2023

Awesome; I am glad to learn that worked for you!

0 votes
Quinn Campbell October 31, 2023

So I was going to write I'm not sure where you wanted me to write in the refence to the other values, but to anyone else that comes across this post, where it gives you the 2 options of trigger issue and most recently created, just click the box and start typing. Its not very apparent to newbies as it looks like you can only select from the avaiable options. 

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