Forums

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

Jira create ticket api fails when payload has images

mrinmoy jyoti kaushik August 9, 2020

We have created an automation to create jira tickets using the api "POST /rest/api/<project id>/issue" 

We pass the description as payload and the Jira ticket is opened.

usually it works. But if the ticket description contains image, it fails with the error - "We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file."

 

The process works as below-

1)Our client opens the JSD ticket.

2)They put media (video or image) into the Description

3)Our automation listens for new tickets in JSD.

4)As soon as there is a new ticket in JSD, the automation reads its description and puts the same as payload to the Jira to create a corresponding jira ticket.

5)The automation works as expected unless we have added media into the description. All help is appreciated.

 

 

The failing payload is something like below- (Sensitive info removed)

"description": {
"content": [{
"content": [{
"text": "<Some Text>",
"type": "text"
}],
"type": "paragraph"
}, {
"content": [{
"text": "<Some Text>",
"type": "text"
}],
"type": "paragraph"
}, {
"content": [{
"type": "media",
"attrs": {
"width": 200,
"type": "file",
"id": "<Some Id>",
"collection": "<Some Text>",
"height": 183
}
}],
"type": "mediaSingle",
"attrs": {
"layout": "center"
}
}, {
"content": [{
"text": " ",
"type": "text"
}],
"type": "paragraph"
}, {
"content": [{
"text": "Thanks. ",
"type": "text"
}],
"type": "paragraph"
}, {
"type": "rule"
}, {
"content": [{
"text": "<Some Text>",
"type": "text"
}, {
"text": "<Some Email Id>",
"type": "text",
"marks": [{
"type": "link",
"attrs": {
"href": "<Some weblink>"
}
}]
}, {
"text": ". <Some text>",
"type": "text"
}],
"type": "paragraph"
}],
"version": 1,
"type": "doc"
}

1 answer

0 votes
Warren
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 10, 2020

Hi @mrinmoy jyoti kaushik 

I'm not sure if my answer is going to help you, because you're talking about images within the Description. When I was building an app to create tickets in Jira cloud, I discovered that for attachments, you need to first create the ticket without attachments, and only then add the attachments to the newly-created ticket.

mrinmoy jyoti kaushik August 10, 2020

Hi @Warren 

Thanks for the comment. I can accept that the image can be added only once the ticket is created.

But how is the same working from Jira UI? I can add the image in the Jira description and it shown no issue.

Any workaround in this direction would be really appreciated.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events