Forums

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

How to tag Assignee in issue comments using rest api?

surbhi barnwal April 6, 2023

I have a requirement where I have to tag the Assignee in the comments based on the issue id using rest api.

This is for Servicenow to JIRA integration.

1 answer

0 votes
Tugba Capaci
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.
April 7, 2023

Hi @surbhi barnwal , 

 

Here is the endpoint and body you need to use to tag the assignee in a comment.

 

Example body : 

Screen Shot 2023-04-07 at 11.08.34.png

 

I hope it helps.

 

Tugba from Actioner

actioner.com 

surbhi barnwal April 7, 2023
 var json_data = {}
  //forming json if visiblity access is provided else just add the body in json format
  if(inputs.visibility){
     json_data['visibility'] = {}
     json_data['visibility']['type'] = "role"
     json_data['visibility']['value'] = inputs.visibility
  }
  
   var comment = {
        "type": "doc",
        "version": 1,
        "content": [{
            "type": "paragraph",
            "content": [
{
                "text": inputs.comment,
                "type": "text"
            },
{
               "type": "mention",
               "attrs": {
               "id": "622a29b6c4d0fe0069572578",
               "text": "@John",
               "userType": "APP"
              }
            }
]
        }]
    };
  
  if(inputs.server_type=='cloud' && inputs.api_version==3)
    json_data['body'] = comment;
  
  else
    json_data['body'] = inputs.comment 
  
  outputs.payload = JSON.stringify(json_data)

We are using the REST API V2....no luck with the solution provided. Can you please help with Rest api v2?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events