Copy Description Field from one issue to another with Automation Web Request.
Asked by Malcolm Hinds:

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"}\]}\]}  

<br />

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


Answers:
author: Kalyan Sattaluri
body: Hello [@Malcolm Hinds](/t5/user/viewprofilepage/user-id/5425786)

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](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)

comments: author: Malcolm Hinds
body: Hi [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306) Thanks for helping out.  
I am using a custom data, this is the web request I sent  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/321629i06B9BD2081C36414/image-dimensions/426x752?v=v2 "image.png")

And this is the error  

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/321630i5E0A4BE51EFAC92C/image-size/large?v=v2&px=999 "image.png")  

This was the output of {{issue.description.jsonEncode}} that I had put in the comment to see the value.  
![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/321631i82D6C4E7F35A57E2/image-size/large?v=v2&px=999 "image.png")


author: Kalyan Sattaluri
body: 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>


author: Malcolm Hinds
body: Hi [@Kalyan Sattaluri](/t5/user/viewprofilepage/user-id/5312306) 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!


Tags: automation

cloud

jira-cloud

jira-service-management

jira-service-management-cloud