When creating sub task update parent item with component of sub task

Jeroen Vis April 25, 2018

Hello,

I'm trying to figure out the following use case:

When creating or editing a sub-task, the component(s) of the sub-task must be added (if not already exists) to the parent item.

What I already managed is that on editing the sub-task, the components of the sub-task overwrites all the components of the parent item. I do not want to do that, because it can occur that the parent item has 2 tasks, one for component A and one for component B. I then want the parent item to have both components.

I think I can solve this by the additional fields configuration. I have the following configuration there:

 

{
"update": {
"components": [{
"add": "issue.parent.component"
}]
}
}

But that gives me the following error: "(Field 'components' cannot appear in both 'fields' and 'update')".

Anyone can help me? Thanks.

3 answers

1 accepted

1 vote
Answer accepted
Nick Menere
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.
April 25, 2018

Hi Jeroen,

 

I'm currently working on making fields easier to copy (and also keep original values).

For time time being what you will need to do as add components from the current issue (the parent) and trigger issue (sub-task):

Screen Shot 2018-04-26 at 10.50.28 am.png

This will ensure current components are kept and the new ones are added.

 

Let me know if that works for you.

 

Cheers,

Nick

0 votes
Slava Gefen December 13, 2024

For someone who else like myself 😊

But that gives me the following error: "(Field 'components' cannot appear in both 'fields' and 'update')"But that gives me the following error: "(Field 'components' cannot appear in both 'fields' and 'update')"

The reason of the error is that the field (in our case Components) can't be in both modes: In Fields list and in Advanced Editing. To get rid of that you need to unselect Components in Fields and leave just in Advanced Editing.

This code by the way works like a charm!

{
"update": {
"components": [{
"add": "your component"
}]
}
}

With kind regards
Slava

0 votes
Jeroen Vis April 25, 2018

Nice! Thank you for your quick answer. This works!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events