HTML catalog variable to XML or Jira ADF

Community Alums
Not applicable

Is there a way to take the value from a HTML catalog variable and convert it into an XMLDocumentv2?

 

Here's my situation:  I am integrating ServiceNow to Jira using Jira's v3 REST API (which introduces the Atlassian Document Format (ADF) for text area fields).  The structure of the ADF is JSON and a sample is below.  

I have a catalog item with 3 HTML variables and I need to convert the HTML into the ADF format.  

I'm having trouble just parsing through the HTML.  I'd love to use the XMLDocumentv2 so I can use the XMLDocumentv2 functions but not sure if this is possible.  

Any ideas would be appreciated.

 

Sample ADF structure

(https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/#json-schema)

 

"customfield_10063": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Initial text."
}
]
},
{
"type": "mediaSingle",
"attrs": {
"layout": "center"
},
"content": [
{
"type": "media",
"attrs": {
"id": "xxxxxxx",
"type": "file",
"collection": "",
"width": 1268,
"height": 783
}
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Update 10/25/2022:"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "More text"
}
]
},
{
"type": "codeBlock",
"attrs": {},
"content": [
{
"type": "text",
"text": "{}"
}
]
}
]
}

 

0 REPLIES 0