Forums

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

How to clone an Issue with automation, including checklist and the list of acceptance criteria?

Matthias August 22, 2023

Hi all,

I am cloning stories and sub-tasks with Jira automation, no problem.

But, the clones are missing the checklist and the list of acceptance criteria. I am not able to clone these as well. 

Can anybody help me? 

Thanks! :) 

Unbenannt.PNG

1 answer

1 vote
Maxime Lefebvre _Okapya_
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.
August 22, 2023

Hi Matthias,

I have provided an example how to do this in this community post.


I notice in your screenshots you are using Headers and Mandatory/Optional toggles. In the example I provided, they are not copied, but it's easy to add them to the payload.

Please look at our JSON (Rest API) format to know which properties are available to put in the payload.

Here's an example with added isHeader and mandatory properties:

...
          {

            "name": "{{name}}",
            "checked": {{checked}},
            "status": { "id": "{{status.id}}" },
"isHeader": {{isHeader}},
"mandatory": {{mandatory}}
          }
...

Let me know if this helps!

Kind regards,
Maxime

Matthias August 22, 2023

Hi Maxime, 
thanks for your help! :)

 

Until now, it does not work. I did this:

Unbenannt.PNG

{
"update": {
"labels": [
{
"add": "cloned"
}
],
"issuelinks": [
{
"add": {
"type": {
"name": "Cloners"
},
"outwardIssue": {
"key": "{{issue.key}}"
}
}
}
]
},
{
    "fields": {
      "customfield_14700": [
        {{#issue.ChecklistFieldName}}
          {
            "name": "{{name}}",
            "checked": {{checked}},
            "status": { "id": "{{status.id}}" }
"isHeader": {{isHeader}},
"mandatory": {{mandatory}}
        }
          {{^last}},{{/}}
        {{/}}
      ]
    }
}
}

 

Sorry, I am not a pro :D 

We are using the built-in checkbox field.

This automation rule is only for testing, I know, that I do not need automation for cloning one Issue :D 

Maxime Lefebvre _Okapya_
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.
August 22, 2023

Hi Matthias,

From your screenshots, those are not the built-in checkbox fields, those are Checklist fields from our app Checklist for Jira. I only want to clarify.

I have modified your example to properly integrate the additional field in your existing JSON payload. Also, make sure you put your custom field name in 2 places (you only replaced it in one place in your example).

{
"update": {
"labels": [
{
"add": "cloned"
}
],
"issuelinks": [
{
"add": {
"type": {
"name": "Cloners"
},
"outwardIssue": {
"key": "{{issue.key}}"
}
}
}
],
"customfield_14700": [
{
"set": [
{{#issue.customfield_14700}}
{
"name": "{{name}}",
"checked": {{checked}},
"status": { "id": "{{status.id}}" }
"isHeader": {{isHeader}},
"mandatory": {{mandatory}}
}
{{^last}},{{/}}
{{/}}
]
}
]
}
}

It's worth noting that this only updates one field customfield_14700 and if you want to update two fields you should copy it again then replace both customfield_14700 to your other field id.

Kind regards,
Maxime

Like Matthias likes this

Suggest an answer

Log in or Sign up to answer