Forums

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

Can I automatically register a 'parent item' issue as a linked issue?

clown November 26, 2024 edited

When a 'sub-item' of an issue type 'Task', 'sub-bug', is converted to a 'bug' type, is it possible to create an automated statement that registers the 'bug' issue as an issue that links the previous 'parent item' issue?

 

Reproduction order and expected results.

1. A ‘task’ connected to B ‘sub-bug’

1.PNG

 

2. B ‘sub-bug’ → B ‘bug’

2.PNG

 

3. B 'Bug' - A 'Task' (related to) // Jira Automation

3.PNG

3 answers

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Champion
December 4, 2024

@clown 

If I got your requirement correctly (as described in my answer to your last post) the following rule should do the work

image.png

Whenever a Sub-Bug is converted to a Bug an issue link between the (new) standalone Bug and its former parent issue is created

(the issueType condition is optional - if added it needs to be configured regarding your conditions)

 

As you can see in the "link issue" action a smart value is used for the issue to be linked at (which is the former parent):

{{fieldChange.fromString}}

 

Please give it a shot and let us know if it works or if there are any further questions. In case there are any further problems please provide some material for analyse like screenshots of your rule and audit log

 

Best
Stefan

 

clown December 5, 2024

This was the result of the first answerer's solution first.
Even when I applied the answer you provided, it still didn't work.
There was no audit log left either.

4.PNG

Stefan Salzl
Community Champion
December 5, 2024

Hi,

was there no audit log? Not even an error? no execution at all?

First thing I can see kn your screenshot: your condition checking for issuetype task. As I mentioned in my answer you have to change the condition to the issuetype you are converting to. So when you gonna convert a sub-bug to a bug the condition of your screenshot will be fals therefore the rule won‘t do anything. in this case you need to change the condition to bug. The condition could even be left out at all. that would be good for tests so we know the rule is activating ar your side.

Could you please also share a screenshot of the details of your rule details as well as from your trigger details and also a step by step description what you are doing when you expect the rule to activate.

Best

Stefan

clown December 9, 2024

Hi, Stefan! Sorry for the late reply, I was busy.
First of all, there was no Audit log, and there was no Error.

The direction I want is as follows.
When a Sub-bug, which is a sub-item of a Task, is converted to a Bug issue, a relates to link is attached to each task.

 

Below is the syntax written.

0.PNG

1.PNG 2.PNG 3.PNG 4.PNG 5.PNG

Thank you for your favor.

 

Stefan Salzl
Community Champion
December 10, 2024

Hi @clown 

try without the limitations in for events in the trigger.

Converting an issue is neither an edit nor a transition action. Seems the rule won‘t start according to this condition.

Best
Stefsn

clown December 11, 2024

Problem solved, thank you Stefan!!

Like Stefan Salzl likes this
Stefan Salzl
Community Champion
December 12, 2024

Wooohoooo…..awesome. Glad to hear you got that working. good job 👍🏼

Best
Stefan

1 vote
Marcos Defina
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 2, 2024

When a subtask is converted to task, or a sub-bug is converted to bug - their Parent field is cleaned.

You can use this as a trigger.

Now, to recover the previous parent with no external script will be a problem. 
If you are able to script in python, you can create a listener to this event and previous parent information from the history.

But if not, you can create a custom_field (lets call it last_parent) that would hold parent information during creation. Just create a post-function to update your last_parent to the current parent on sub-task creation time - in this way you will be able to recover last_parent once the sub-task gets promoted to task.

Then your automation will look somewhat like this:Screenshot 2024-12-02 234338.png

  1. When Value of Parent changes to Empty
  2. If Issue Type In {Task, Bug}
  3. Edit Issue Fields using Advanced Field Editing to insert current_issue.last_parent into the new issuelinks (this part will take some trying and error to get the syntax correct)

 

Hope it helps!

Bests,
Marcos Defina.

 

Stefan Salzl
Community Champion
December 2, 2024

Hi @clown & @Marcos Defina 

there are smart values for fieldChanges. the following screenshow shows how the former issue (parent) can be fetched:

image.png

 

find more detailed information here:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--

 

Best
Stefan

Like Marcos Defina likes this
0 votes
clown December 4, 2024

@Marcos Defina cc. @Stefan Salzl 

Hi, I tried it but it doesn't seem to work. The question I was asking was about attaching a "Linked Issue" instead of the "parent" automation for transitioning sub-bugs or sub-tasks.

Stefan Salzl
Community Champion
December 4, 2024 edited

what did you try? what didn‘t work? could you show the result and/or your rule and the audit log of your run?

You need to get the former parent. How should the automation know where to link the „new“ issue? we were just pointing out how to manage the start. Linking need to be done in the automation.

Thanks in advance

Best
Stefan

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.

Register today!
AUG Leaders

Atlassian Community Events