How to add hyperlink in description while creating Jira Ticket using REST API?

prabhu September 11, 2023

Hi team,

I am trying to add hyperlink in description for the Jira ticket using REST API. If I add the hyperlink its storing as text only. Since I didn't find anything about this in Documentation, asking here in community to find better solution.

{"description",{"content":{{"content":{{"text":"Kindly copy and paste the below link in web browser to access the Last Week Candidates missed out report. ","type":"text"},{"type":"hardBreak"},{"text":Field1,"type":"text"}},"type":"paragraph"}},"type":"doc","version":1}}

In Field 1 we will add the hyperlink. We have tried html tags too, but its not working.

3 answers

1 accepted

5 votes
Answer accepted
Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

Hi, @prabhu 

Welcome to Atlassian community. 

It's kinda tricky. Here is example, how request body must look like:

"description": {
    "version": 1,
    "type": "doc",
    "content": [
        {
            "type": "paragraph",
            "content": [
                {
                    "type": "text",
                    "text": "TEST",
                    "marks": [
                        {
                            "type": "link",
                            "attrs": {
                                "href": "https://mail.ru"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
prabhu September 11, 2023

Yeah this works. Thanks @Evgenii . Can you also post where did you find these syntax for JIRA REST API. That will be useful for community.

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 11, 2023

Yes, sure. 

Just looked at issue information, received  through JIRA REST API

https://example.atlassian.net/rest/api/3/issue/ABC-123

Here is more detailed information about REST API

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-group-issues

Like prabhu likes this
prabhu September 13, 2023

@Evgeniy Can you also give syntax for how to create an issue by default as in TO-DO List instead of that ticket going in Backlog?

0 votes
Victor Klüber November 21, 2024

How does that work when the link should be there somewhere in the middle of some text. Could somebody please share an example?

Victor Klüber November 21, 2024

Solution to my question:

 

"description": {
"content": [
{
"type": "paragraph",
"content": [
{
"text": "some text,
"type": "text"
},
{
"type": "text",
"text": "Documentation link",
"marks": [
{
"type": "link",
"attrs": {
"href": "https://attlassian.com"
}
}
]
}
]
}
],

"type": "doc",
"version": 1
},
0 votes
prabhu September 13, 2023

@Evgenii Can you also give syntax for how to create an issue by default as in TO-DO List instead of that ticket going in Backlog?

Evgenii
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 13, 2023

Hi, @prabhu 

Sorry, I don't understand your question, what you want to do. Can you add more details to usecase?

If your ticket, after creation, goes to Backlog, and you want to transition it to another status, you can make one more REST API request, to transition created issue to needed status.

prabhu September 13, 2023

If your ticket, after creation, goes to Backlog, and you want to transition it to another status, you can make one more REST API request, to transition created issue to needed status.

- Yes that's correct. I want my ticket to create as TO-DO from the beginning without calling one more REST API request. And I want to know the syntax for that.

Suggest an answer

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

Atlassian Community Events