Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,257,463
Community Members
 
Community Events
164
Community Groups

Adding approvers with API

How do you use the API to add approvers to a request, or to create a request that requires approvers?

1 answer

0 votes

Hi @steve chappell,

Thanks so much for your question.

You can follow the REST API documentation to achieve this - have a look at: https://docs.atlassian.com/jira-servicedesk/REST/4.13.0/#servicedeskapi/request-createCustomerRequest

The above tells you how to create a request via the API. All you need to do is to add a parameter to the body of the request that corresponds to the Approvers field in your workflow. It will be a custom field of Jira, so to add it to the request you will need to know the custom field ID first. To get it, you can watch the network tab on your browser when creating the request via the Customer Portal, or go to your project settings → Fields → search for the Approvers field on the list, and look at the link in the Screens column - it will have the custom field ID in the link address. In my case, it is customfield_10202, so what I need to do is to put it inside the request body is:

{
// regular request body as in the docs
customfield_10202: username
}

Editing the field value after the request is created is very similar, you will need to know the issue key or id for that, and use this endpoint as described in the jira docs: https://docs.atlassian.com/software/jira/docs/api/REST/8.13.0/#api/2/issue-editIssue

Thank you,

Bart
Jira Service Desk

Editing the field value after the request is created is very similar, you will need to know the issue key or id for that, and use this endpoint as described in the jira docs: https://docs.atlassian.com/software/jira/docs/api/REST/8.13.0/#api/2/issue-editIssue

 

I dont think this is true, see this: https://community.atlassian.com/t5/Jira-Service-Management/Adding-approver-using-API-instead-of-manual-agent-action/qaq-p/1369888 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
4.12.2
TAGS
Community showcase
Published in Jira Service Management

Safe customer notifications in Jira Service Management for compliance and privacy needs

Announcing safe customer notifications in Jira Service Management as a building block for compliance and privacy needs At Atlassian, we understand the increasing need to be assured that your data i...

344 views 1 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you