Expand my Community achievements bar.

Basic Auth Request to Jira has Trouble Parsing JSON for Description

Avatar

Level 2

Hi Fusion Community,


Has anyone used a Basic Auth Request module to create (POST) a Jira task?

 

I'm successfully able to do this, but here's the one issue I run into:

  1. I'm referencing the Workfront task Description field (in an upstream module)
  2. If a Workfront task's Description value has either hard returns or special characters in them, my Auth Request module creating the related Jira tasks produce a 400 error ("There was an error parsing JSON. Check that your request body is valid.") and doesn't end up creating those specific tasks.  JSON posted at bottom of this thread.

 

I'm using multiple variable modules upstream:

  1. To encode and replace hard returns for Workfront Task Description (see screenshot 1 below); then,
  2. I use another variable modules after that one to decode and replace hard returns (see screenshot 2 below).  This is then the value I reference in the Basic Auth Request module downstream for the Description field when creating Jira tasks.

Any suggested resolutions is greatly appreciated.

Thanks,

Nick

 

SCREENSHOT 1

NickVa11_1-1767997060057.png

 

SCREENSHOT 2

NickVa11_2-1767997516318.png

 

 

Basic Auth Request Module JSON

 

Auth request module JSON:

{
"fields": {
"project": {
"key": "{{22.data.key}}"
},
"issuetype": {
"name": "Task"
},
"parent": {
"key": "{{24.data.key}}"
},
"assignee": {
"accountId": "{{40.data[].accountId}}"
},
"summary": "{{26.name}}",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "{{123.decodeTaskDescription}}"
}
]
}
]
},
"duedate": "{{119.adjustedCompletionDate}}",
"customfield_10015": "{{119.adjustedStartDate}}",
"customfield_11250": "{{26.ID}}",
"customfield_11315": [
{
"value": "No"
}
],
"customfield_11249": "https://shiftparadigm.my.workfront.com/task/{{26.ID}}/overview"
}
}

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Community Advisor

Hey @NickVa11 
can you share the resulting JSON and/or error msg 

If the JSON has issues I often use tools like jsonlint to help me find the offending char(s) 

Avatar

Level 2

Hey @Sven-iX ! 

It's Nick from Shift Paradigm, we go way back.  Adobe has assigned me new profiles a few times.  I haven't looked into why.

 

Error messages for both: 400 There was an error parsing JSON. Check that your request body is valid.

 

Below are the inputs (request content) for two tests; one when using hard returns in the Description field and one using special characters.

 

Hard Returns:

{
  "fields": {
    "project": {
      "key": "WFJR26799"
    },
    "issuetype": {
      "name": "Task"
    },
    "parent": {
      "key": "WFJR26799-1"
    },
    "assignee": {
      "accountId": "712020:16950127-3e22-4f0c-a969-bdbcde980bfe"
    },
    "summary": "Project Setup",
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "This is a test with hard returns in the description

See, I hard-returned."
            }
          ]
        }
      ]
    },
    "duedate": "2026-01-15",
    "customfield_10015": "2026-01-08",
    "customfield_11250": "696015de0004d5a4b7a84b735fbce58e",
    "customfield_11315": [
      {
        "value": "No"
      }
    ],
    "customfield_11249": "https://shiftparadigm.my.workfront.com/task/696015de0004d5a4b7a84b735fbce58e/overview"
  }
}

 

Special Characters:

{
  "fields": {
    "project": {
      "key": "WFJR26799"
    },
    "issuetype": {
      "name": "Task"
    },
    "assignee": null,
    "parent": {
      "key": "WFJR26799-1"
    },
    "summary": "Client Kickoff Task (DO NOT DELETE)",
    "description": {
      "type": "doc",
      "version": 1,
      "content": [
        {
          "type": "paragraph",
          "content": [
            {
              "type": "text",
              "text": "This is a test with special characters @#$!%^&*()/"'~"
            }
          ]
        }
      ]
    },
    "duedate": "2026-01-08",
    "customfield_10015": "2026-01-08",
    "customfield_11250": "696015de0004d585dd7cf0b8643fdb0d",
    "customfield_11315": [
      {
        "value": "No"
      }
    ],
    "customfield_11249": "https://shiftparadigm.my.workfront.com/task/696015de0004d585dd7cf0b8643fdb0d/overview"
  }
}

 

Thanks!

 

Avatar

Community Advisor

Heya Nick! 

 

I DM'd you - but in the above I see 2 issues: in JSON, a real line break (hard return) is illegal, and a double quote needs to be escaped

SveniX_0-1768249489088.png

should be 

          "content": [
            {
              "type": "text",
              "text": "This is a test with hard returns in the description\n\nSee, I hard-returned."
            }
          ]

 

and 

SveniX_1-1768249566293.png

should be

          "content": [
            {
              "type": "text",
              "text": "This is a test with special characters @#$!%^&*()/\"'~"
            }
          ]