Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Click Apps in the top > Approval Path for Jira > API Keys > Create a new API Key

Then add the Authorization header to your HTTP request:

Authorization: Bearer mc96LyRi9nUQySSjKXEf8xfqUZzjS2CYhRK8bWSRRfQi

Endpoints

Base path: https://app.approval-path.com/webapi

Approval

ref-id- In the case of Approval Path for Jira, this is issue id or issue key.

List approvals

GET /approvals/{ref-id}

Return example:

...

titleExample response data

...

languagejson

...

Setup your API key and copy or download it. The template has the following fields:

  • Key name - provide your name for the API key, up to 40 characters long.

  • Key value - non-modifable field, shows the value of the key.

  • Reveal - reveals the key. This is NOT one time operation - you can reveal the key at any time.

  • Download - downloads the key to the selected location.

  • Get issue approval status - determines whether list approval for issue operation is allowed for the key.

  • List approval definitions - determines whether list approval definition operation is allowed for the key.

  • Create approval for issue - determines whether create operation is allowed for the key.

  • Delete approval - determines whether delete operation is allowed for the key.

  • Allow change performer origin - presents a valuable customization capability for users, empowering them to personalize change performer. Once checked, users are granted the flexibility to adjust performer origin according to their chosen parameters.

...

Change Performer Origin select offers three distinct options:

  1. User - to ensure smooth operations, it is essential to select a valid user as the new performer. This can be done by utilizing the option that allows the selection of a specific user.

  2. Issue field User - allows you to select an issue field of type User (or User array first element) to fetch the new performer. In cases where the selected issue field does not contain a valid user, you have the option to choose a default user. However, if no default user is selected and the issue field still does not contain a valid user, the API call will return an error.

    Image Added

  3. User from API call - API call body parameter allows for the passing of a user id. User ids can be limited to users from a designated group. In cases where the submitted user id is empty or does not contain a valid user, a default user can be selected. However, if the submitted user does not belong to the specified group, an error will be returned.

    Image Added

  • Not valid before - set the start date for key validity.

  • Not valid after - set the invalidation date for the key.

  • Allowed IPs - set IPs or IP range that can use the key.

  • Description - description of the key. Maximum 4000 characters.

  • Creation time - non-modifable field, the time when the key was created.

  • Last modified - non-modifable field, the time when the key was last modified.

  • Last usage - non-modifable field, the time when the key was last used.

  • Usage Count - non-modifable field, counter that shows how many times the key was used.

Using the Web API with API key

With key generated, you can now make a call to Web API. First of all, set Authorization and Content-Type headers in your REST client.

Code Block
Authorization: Bearer mc96LyRi9nUQySSjKXEf8xfqUZzjS2CYhRK8bWSRRfQi
Content-Type: 'application/json'

Endpoints

Base path: https://app.approval-path.com/webapi

Definition

ref-id- In the case of Approval Path for Jira, this is project id or project key.

List of project definitions

GET /approval-definitions/{ref-id}

List of global definitions

GET /approval-definitions

Expand
titleExample response data
Code Block
languagejson
{
  "result": [
    {
      "id": "53",
      "name": "users with create condition",
      "description": "",
      "collectionId": null,
      "steps": [
        {
          "type": "USER",
          "parallelGroupNumber": null,
          "userId": "557058:6e542a10-54a5-44e3-97b4-397df9caf04d",
          "action": "NOTIFICATION",
          "displayName": "Kamil Zarychta",
          "lastUpdated": null,
          "issueWatchersNotification": "ENABLED",
          "condition": {
            "id": 2
          }
        },
        {
          "type": "USER",
          "parallelGroupNumber": null,
          "userId": "557058:6e542a10-54a5-44e3-97b4-397df9caf04d",
          "action": "APPROVAL",
          "displayName": "Kamil Zarychta",
          "lastUpdated": null,
          "issueWatchersNotification": "ENABLED",
          "condition": {
            "id": 1
          }
        },
        {
          "type": "USER",
          "parallelGroupNumber": null,
          "userId": "557058:6e542a10-54a5-44e3-97b4-397df9caf04d",
          "action": "CONSENT",
          "displayName": "Kamil Zarychta",
          "lastUpdated": null,
          "issueWatchersNotification": "ENABLED",
          "condition": {
            "id": 2
          }
        }
      ],
      "rejectionSteps": [],
      "createApprovalCondition": {
        "id": "38" 1
      },
      "definitionIdavailableForJSMCustomers": "35", false
    },
    {
      "nameid": "Approval Name95",
      "summaryname": "Ticket Summaryparallel group with rejection steps",
      "collectionIddescription": "10002",
      "refIdcollectionId": "10004"null,
      "steps": [
        {
          "type": "USER",
          "statusparallelGroupNumber": "SUCCESS"null,
          "userId": "557058:aea7ac026e542a10-75c154a5-4f47-9beb-dd89777d4949",
          "displayName": "Krzysztof Bogdan44e3-97b4-397df9caf04d",
          "avatarUrlsaction": {
  "APPROVAL",
         "48x48": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/48",
  "displayName": "Kamil Zarychta",
          "32x32": lastUpdated"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/32": null,
            "24x24issueWatchersNotification": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/24""ENABLED"
        },
        {
   "16x16": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/16"       "type": "USER",
          "parallelGroupNumber": 1,
          "userId": "557058:6e542a10-54a5-44e3-97b4-397df9caf04d",
          }"action": "APPROVAL",
          "actiondisplayName": "STARTEDKamil Zarychta",
          "decisionlastUpdated": "ACCEPTED"null,
          "decisionDateissueWatchersNotification": "2021-09-30T13:51:01.676+00:00"ENABLED",
        }
  "condition": {
     ],       "statusid": "IN_PROGRESS" 3
          }
       ] },
  "totalCount": 1 }

Create or get approval

POST /approvals/{ref-id}

Expand
titleExample body
Code Block
languagejson
{
  "definitionId    {
          "type": "idEMAIL",
  "summary": "Approval summary. Usually issue/page title"
}

Reset approval

Allows user to reset ongoing or finalized approval path on an issue.

POST /approvals/{ref-id}/reset

Object: createComment
The “createComment” object, if “True”, will generate a comment when approval path is reset via API. The creator of the API will be specified as the agent.

Expand
titleExample body
Code Block
languagejson
{}

This will reset the approval path - by default no comment will be generated.

Code Block
languagejson
{"createComment": true}

This will reset the path and generate a comment.

Expand
titleExample response
Code Block
languagejson
{        "parallelGroupNumber": 1,
          "email": "kamilzarychta@gmail.com",
          "action": "APPROVAL",
          "resultissueWatchersNotification": [ "ENABLED"
        },
      {  {
          "idtype": "469GROUP",
            "definitionIdparallelGroupNumber": "197"1,
            "namegroupId": "QA83ebf594-d9e8-44c6-8ef6-db8a152d0009",
 
          "summary": "QA-33 Demo task",
 action": "APPROVAL",
          "collectionIdrequiredVotes": "10000"1,
 
          "refIdrequiredRejectVotes": "10068"3,
            "stepsdisplayName": ["administrators",
          "approvalCreatorExcluded": false,
    {          "skipFromApprovalWhenEmpty": false,
          "typeissueWatchersNotification": "USERENABLED",
        }
      ],
      "typerejectionSteps": "USER",[
         {
          "statustype": "SUCCESSHTTP",
          "parallelGroupNumber": null,
          "userIdname": "6105b29ec51f3a0069c9ccdawebhook2",
          "httpMethod": "GET",
          "displayNameurlTemplate": "Parsa Shivahttps://webhook.site/d42d1f3d-74a8-433e-b5a3-961d46505fe4?test=test",
                   "headersTemplate": "parallelGroupNumber":,
 null,         "bodyTemplate": "            "avatarUrls":  {  ",
          "action": "NOTIFICATION",
          "48x48": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png",
  issueWatchersNotification": "DISABLED"
        }
      ],
      "createApprovalCondition": null,
      "32x32availableForJSMCustomers": false
    "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png",
              }
  ],
  "totalCount": 2
}

Approval

ref-id- In the case of Approval Path for Jira, this is issue id or issue key.

List approvals

GET /approvals/{ref-id}

Return example:

Expand
titleExample response data
Code Block
languagejson
{
  "result": [
    {
         "24x24id": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png",
38",
      "definitionId": "35",
      "name": "Approval Name",
      "16x16summary": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png"Ticket Summary",
      "collectionId": "10002",
      "refId": "10004",
      },
"steps": [
        {
          "actiontype": "STARTEDUSER",
          "status": "SUCCESS",
          "decisionuserId": "ACCEPTED557058:aea7ac02-75c1-4f47-9beb-dd89777d4949",
          "displayName": "Krzysztof  Bogdan",
          "decisionDateaction": "2022-09-26T15:32:42.340+00:00STARTED",
          "decision": "ACCEPTED",
          "lastUpdateddecisionDate": "20222021-09-26T1730T13:3251:4201.676+0200:00"
        }
       }],
                {
 "status": "IN_PROGRESS"
    }
  ],
  "totalCount":     1
}

...

When Change Performer Origin 'USER' is selected for API key approval create and reset requests can be extended to include the userId field.

Create approval

POST /approvals/{ref-id}

Expand
titleExample body
Code Block
languagejson
{
  "typedefinitionId": "USERid",
  "summary": "Approval summary. Usually issue/page title",
            "type"userId": "USER",Atlassian user                    "status": "SUCCESS",
                    id"
}

...

Reset approval

Allows user to reset ongoing or finalized approval path on an issue.

POST /approvals/{ref-id}/reset

Body parameters
createComment - Default false. If true, will generate a comment when approval path is reset via API. The creator of the API will be specified as the agent.

Expand
titleExample body
Code Block
languagejson
{
  "userId": "6105b29ec51f3a0069c9ccda",Atlassian user                 id"
}

This will reset the approval path - by default no comment will be generated.

Code Block
languagejson
{
  "createComment": true,
  "displayNameuserId": "ParsaAtlassian user Shivaid",
   
}

This will reset the path and generate a comment.

Expand
titleExample response
Code Block
languagejson
{
                "parallelGroupNumber": null,"result": [
        {
            "avatarUrlsid": {"469",
            "definitionId": "197",
            "48x48name": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.pngBussines trip",
            "summary": "TRA-33 Trip to Vegas",
            "32x32collectionId": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png",10000",
            "refId": "10068",
            "24x24steps": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png", [
                {
                    "16x16type": "https://secure.gravatar.com/avatar/2ed481ded6c12e2eeb9e41992258c212?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPS-0.png"USER",
                    }"type": "USER",
                    "actionstatus": "APPROVALSUCCESS",
                    "decisionuserId": "ACCEPTED6105b29ec51f3a0069c9ccda",
                    "decisionDatedisplayName": "2022-09-26T15:32:52.128+00:00Parsa Shiva",
                    "lastUpdatedparallelGroupNumber": null,
                  }  "action": "STARTED",
                {    "decision": "ACCEPTED",
                    "typedecisionDate": "USER2022-09-26T15:32:42.340+00:00",
                    "typelastUpdated": "USER",2022-09-26T17:32:42+02:00"
                    "status": "SUCCESS"},
                {
   "userId": "6299df401648f2006963deb8",
                    "displayNametype": "Jessica SmithUSER",
                    "parallelGroupNumber": null,          "type": "USER",
         "avatarUrls": {          "status": "SUCCESS",
             "48x48": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png",      "userId": "6105b29ec51f3a0069c9ccda",
                    "32x32displayName": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png",
   Parsa Shiva",
                    "parallelGroupNumber": null,
                    "24x24action": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png",APPROVAL",
                    "decision": "ACCEPTED",
                    "16x16decisionDate": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png"2022-09-26T15:32:52.128+00:00",
                    "lastUpdated": null
 },               },
             "action": "APPROVAL",   {
                    "decisiontype": "ACCEPTEDUSER",
                    "decisionDatetype": "2022-09-27T09:23:07.459+00:00USER",
                    "lastUpdatedstatus": null"SUCCESS",
                },      "userId": "6299df401648f2006963deb8",
          {                     "type"displayName": "USERJessica Smith",
                    "typeparallelGroupNumber": "USER"null,
                    "statusaction": "SUCCESSAPPROVAL",
                    "userIddecision": "6299df401648f2006963deb8ACCEPTED",
                    "displayName": "Jessica Smith""decisionDate": "2022-09-27T09:23:07.459+00:00",
                    "parallelGroupNumberlastUpdated": null,
                 },
  "avatarUrls": {              {
          "48x48": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png",
             "type": "USER",
                    "32x32type": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png",USER",
                    "status": "SUCCESS",
              "24x24": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png",     "userId": "6299df401648f2006963deb8",
                    "16x16displayName": "https://secure.gravatar.com/avatar/3f5cd3c6792bea81a464bbb4a2b62396?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FJS-6.png"Jessica Smith",
                    "parallelGroupNumber": }null,
                    "action": "APPROVAL",
                    "decision": "ACCEPTED",
                    "decisionDate": "2022-09-27T09:23:10.706+00:00",
                    "lastUpdated": null
                }
            ],
            "status": "SUCCESS",
            "activeSteps": [],
            "modificationDate": "2022-09-27T09:23:10.706+00:00"
        }
    ],
    "totalCount": 1
}