Forums

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

Copy Element Connect Field with JSON in Automation

Gor Greyan
Contributor
May 13, 2024

Hi Colleagues.

Please help me with this case.

I have automation, which opens sub-task. In the main ticket I have Element Connect field, which I want to copy in the sub-task via Additional fields JSON, but I can't. 
Kindly ask you to help with the JSON syntax.

Thanks in advance.

2 answers

1 accepted

1 vote
Answer accepted
Simon Laffont
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.
May 14, 2024

Hello @Gor Greyan

I am part of the Elements Connect support team.

Where is the Automation rule triggered, in the sub-task or in its parent? Can you please share a screenshot to show us how your automation rule is configured?

Kind regards,
Simon.

Gor Greyan
Contributor
May 14, 2024

AUTOMATIOn_1.png

Gor Greyan
Contributor
May 14, 2024

Hi Dear @Simon Laffont ,
Automation is triggered when the issue goes to Recruitment status, after that sub-task is created with this automation. I want to copy the Element Connect field from the Recruitment task into the created sub-task.

Simon Laffont
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.
May 14, 2024

Hi @Gor Greyan

Alright, thank you.

I think @Zuri Suwru's answer was good, but you should use "triggerIssue" instead of "parentIssue", like this:

{
"fields": {
"customfield_20137": {{triggerIssue.customfield_20137.asJsonStringArray}}
}
}

Can you please try it and let me know if it works?

If the problem persists, please tell me the type of the connect field you are using (Live Text, Live User, Snapshot Text, etc...) and also if it's single or multi-value.

Kind regards,
Simon.

Gor Greyan
Contributor
May 14, 2024

Dear @Simon Laffont ,
It is worked for me.
Thank you very much for help.

Simon Laffont
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.
May 15, 2024

You are welcome. 

Have a nice day. :)

0 votes
Zuri Suwru
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.
May 14, 2024

Hey there,

Make sure to copy the custom field's value "asJsonStringArray".

"customfield_12345" : {{ issue.customfield_12345.asJsonStringArray }}

I would also suggest double checking whether the custom field is properly configured for your sub-tasks or not.

Hope this helps,
Zuri

Gor Greyan
Contributor
May 14, 2024

Hi @Zuri Suwru ,
Tried this, but got the following error.
Error while parsing additional fields. Not valid JSON.

Gor Greyan
Contributor
May 14, 2024

JSON.png

Zuri Suwru
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.
May 14, 2024

Pardon me, I though you were interested in the syntax for the specific field in question. I did not think you need a complete JSON code.

Can you try it like this?

{
"fields": {
"customfield_20137": "{{parentIssue.customfield_20137.asJsonStringArray}}"
}
}
Like Simon Laffont likes this
Gor Greyan
Contributor
May 14, 2024

Dear @Zuri Suwru ,
Tried also this, and automation succeeded, but the field is not being copied.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events