Forums

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

Bypass emojis in API

Batata Saeed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2020

Hello,

I have been to publish tickets through the Jira Cloud API.

My description contains :p and when I'm creating the ticket it is showing as an emoji.

I'm using python so If I want to escape using backslash I'd get two backslashes as output.

Any ideas?

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 27, 2020

Hello @Batata Saeed ,

Thanks for reaching out, and to escape the characters that are being converted to emojis in your API posts there are a few options.

First if you switch to use the New Jira Issue View , the system now uses a Markdown editor instead fo the Markup editor used in the classic view and the auto conversion of special characters like ":P" will no longer convert to   and use a new ":emoji:" formatting instead for the conversions.

Alternatively using the Classic Issue view, you can disable the wiki-style render for the text fields that you are using in your API calls to avoide posting a special characters as emojis on a conversion by switching the field render to text, or you could add noformat or code macro blocks around any syntax you are posting to make sure that the contents are not modified via the Wiki markup.

The following EXE uses both a noformat and Code block macro, and would only encapsulate the ":P" and ":)" values in a comment but I would recomend adding one of these formatting options around the full section of any code snippet you are planning to post to a issue.  The following is the data package for a  "POST /rest/api/3/issue/{issueIdOrKey}/comment" and would render like the screenshot below:

Screen Shot 2020-01-27 at 10.28.30 AM.png

{
"body": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "TEST EMOJI POST with noformat and Code blocks"
}
]
},
{
"type": "codeBlock",
"attrs": {},
"content": [
{
"type": "text",
"text": ":P"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": " "
}
]
},
{
"type": "codeBlock",
"attrs": {
"language": "java"
},
"content": [
{
"type": "text",
"text": ":)"
}
]
},
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "additional words outside formatting"
}
]
}
]
}
}

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events