Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Copy Description Field from one issue to another with Automation Web Request.

Malcolm Hinds May 1, 2024

I want a Jira Automation rule to send a web request and create a new issue in another Project on a different site.

The problem I am facing is the description. Since the Description uses the ADF format it's hard to make a web request that will copy the description of the current issue when creating a new issue.

I almost got it, by making a webrequest first to get the current issue, then just copy the ADF formatted data from description field  with {{webresponse.body.fields.Description}}

The problem is this doesn't look like valid Json anymore.

so it will look like 
{version=1, type=doc, content=[{type=paragraph, content=[{type=text, text=This is just some sample text}]}]}

instead of this
{"version": 1, "type": "doc", "content": [{"type": "paragraph", "content": [{"type": "text", "text": "This is just some sample text"}]}]}


Any help would be appreciated if there are other ways to accomplish this!

1 answer

1 accepted

4 votes
Answer accepted
Kalyan Sattaluri
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 1, 2024

Hello @Malcolm Hinds 

How you are sending this data over to other Jira instance?

Jira has default "send issue data" and there is custom data.  Can you clarify?

I usually send data across projects in same instance and I dont have this issue..

May be as a test, can you choose "Custom Data" and enforce json Encoding on the description field and test if its getting received correctly?

Please see below link:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Json-encoding:~:text=Atlassian%20Support,version%0A%7B%7Bissue.summary.jsonEncode%7D%7Dpo 

 

Malcolm Hinds May 2, 2024

Hi @Kalyan Sattaluri Thanks for helping out.
I am using a custom data, this is the web request I sent

image.png

 

And this is the error

image.png

This was the output of {{issue.description.jsonEncode}} that I had put in the comment to see the value.
image.png

 

 

Kalyan Sattaluri
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 2, 2024

Hmm, instead of 

"description" : "{{issue.description}}",

have you tried below JSON in its place,

"description": {
          "type": "doc",
          "version": 1,
          "content": [
            {
              "type": "paragraph",
              "content": [
                {
                  "type": "text",
                  "text": "{{issue.description.jsonEncode}}"
                }
              ]
            }
          ]
        },


https://community.atlassian.com/t5/Jira-questions/Getting-Error-quot-Operation-value-must-be-an-Atlassian-Document/qaq-p/1304733

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post

Malcolm Hinds May 2, 2024

Hi @Kalyan Sattaluri I tried to it like this before but didn't add .jsonEncode and would have errors when there was quotes and new line characters, But with it seems to work much better.

Was hoping there was a way to keep the Atlassian Document Format and keep some of the advanced formatting like code blocks, but this is good enough.

Thanks you!

Like Kalyan Sattaluri likes this

Suggest an answer

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

Atlassian Community Events