Jira Clone - JSON for Single value copy ( dropdown fields)

marianna_taborda November 4, 2024

Hey!

 

I'm trying to create a cloning rule that copies a ticket from one project to another. On both issue types we have a dropdown field with a list of values that I need to be able to clone in order to allow for a new ticket creation. 

I've been basing the JSON on this documentation, using both the "id" and the "value" options with no success. On our instance we have too many fields sharing the same name, so I'm unable to choose this field from the list of fields to set. Screenshot 2024-11-05 at 07.35.20.pngScreenshot 2024-11-05 at 07.37.47.png

 

I've already reviewed all the values in the dropdowns and they do match. The only way I've managed to get this to work is using userinputs, which is frustrates the goal to automate post resolution the cloning into the other board. Any advice would be very much appreciated, thank you! 

4 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2024

Hello @marianna_taborda 

What types of projects are the source project and destination project? Get that information from the Type column of the View All Projects page under the Projects menu.

If either is a Team Managed project, are any of the custom fields that are involved custom fields that were created locally in the Team Managed project vs. custom fields created globally and re-used in the Team Managed projects?

Have you tried something like this:

{ "fields": 
{
"customfield_38811": {"value": "{{triggerIssue.customfield_35254.value}}"}
}
}
marianna_taborda November 5, 2024

Hey @Trudy Claspill , thank you so, so much! This worked already!

Both projects are team managed service projects and the fields are created locally. 

 

If you can help me on another JSON related issue on this same rule: I have tried in the past to get a small text as well as a link populated in a paragraph field in the destination issue. I've used:

"customfield_41340": {
"update": "The linked escalation was opened for {{now.diff(issue.created).days.abs}} days. An option to elf-service of Confluence could've improved the customer outcomes and support's performance. For more details, refer to the linked issue or our Slack escalation via", "{{triggerIssue.customfield_44543}}"} 

 

Apart from my ambitions here, what can be wrong with this JSON? I tried to use this syntax:

 "customfield_11448" : [ { "value": "option1" }, { "value": "option2" } ]

I lack the global admin permission, so I'm only able to set the rules in my project. This means that i'm unable to brach and edit this field post-cloning, right?  

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2024

Hello @marianna_taborda 

What is the field types of customfield_41340 and customfield_44543?

Are you getting an error in rule execution log related to updating this custom field?

What is actually in the field in the issue after this rule executes?

marianna_taborda November 8, 2024

Hey @Trudy Claspill , 

 

Sorry for the delay. The customfield_41340 is a paragraph field in the destination project an dthe other custom field is a URL field in my project. The error I get is:

Clone issue
Error while parsing additional fields. Not valid JSON.
This causes a failure to clone seeing as the destination field is required 😕
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 8, 2024

What is the entire JSON code block?

If it is exactly as you have presented it, then you indeed have it formatted incorrectly based on the formatting information here:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/

If you want to use the "update" syntax then change it thus:

 

{
"update": {
"customfield_41340": {
"set": "The linked escalation was opened for {{now.diff(issue.created).days.abs}} days. An option to elf-service of Confluence could've improved the customer outcomes and support's performance. For more details, refer to the linked issue or our Slack escalation via", "{{triggerIssue.customfield_44543}}"
}
}
}

 

0 votes
Luka Hummel - codefortynine
Atlassian Partner
November 11, 2024

Hi @marianna_taborda,

If you're looking to streamline cloning configurations, our app Deep Clone for Jira can simplify the process considerably by allowing simple cloning of issues between projects with full control over fields, including custom dropdown fields, text fields, and more.

Since you’re working in a team-managed environment, Deep Clone allows cloning of team-managed fields seamlessly (as long as the field names are identical) and does not require global admin permissions. This should help streamline your workflow and reduce complexity in setting up cloning rules across your projects.

0 votes
Clara Belin-Brosseau_Elements
Atlassian Partner
November 5, 2024

Hello @marianna_taborda

As an alternative to Automation (that can be complex sometimes), I would suggest trying our app Elements Copy & Sync to clone issues in Jira. It's automated and easier to set up.

It allows you to clone Jira issues with all their content (summary, description, custom fields, comments, attachments…). You can even sync the clone and source issue if needed.

You can check the guide here

The app is for free during 30 days (and it stays free under 10 users).

0 votes
Cristian0791
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.
November 5, 2024

Hi Marianna,

Please check the context of the custom field. The context may be different from project to project.

 

 

Hope this helps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events