Versions Compared

Key

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

...

It is available in the Approval Path global view:

  1. Click “Apps” on the top menu,

  2. Click Approval Path,

  3. Go to the API Keys tab,

  4. Click “Create a new API Key”.

Then add the Authorization header to your HTTP request:

Authorization: Bearer mc96LyRi9nUQySSjKXEf8xfqUZzjS2CYhRK8bWSRRfQi

...

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-modifiable 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 page approval status - determines whether list approval for page operation is allowed for the key.

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

  • Create approval for page - 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. Page creator - you to set user who created the page as the new change performer. In cases where the field does not have a valid user, you have the option to assign a default page creator to ensure continuity.

    Image Added

  3. Page modifier - you can set user who last modified the page as the new change performer. In instances where the field lacks a valid user, you retain the option to select a default page modifier, ensuring a smooth transition in the performer's origin.

    Image Added

  4. 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-modifiable field, the time when the key was created.

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

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

  • Usage Count - non-modifiable 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'

Definition

ref-id- In the case of Approval Path for ConfluenceJira, this is page space id.

List

...

of space definitions

GET /approvalsapproval-definitions/{ref-id}Return example:

List of global definitions

GET /approval-definitions

Expand
titleExample response data
Code Block
languagejson
{
  "result": [
    {
      "id": "45",
      "name": "38with rejection steps",
      "definitionIddescription": "35""",
      "collectionId": null,
      "namesteps": [
        {
    "Approval Name",      "type": "USER",
          "summaryparallelGroupNumber": 1,
          "userId"Ticket Summary",: "557058:6e542a10-54a5-44e3-97b4-397df9caf04d",
          "collectionIdaction": "10002CONSENT",
          "refIddisplayName": "10004",Kamil Zarychta",
          "lastUpdated": null,
          "stepsissueWatchersNotification": ["ENABLED"
        },
        {
          "type": "EMAIL",
          "USERparallelGroupNumber": 1,
          "statusemail": "SUCCESSkamilzarychta@gmail.com",
          "userIdaction": "NOTIFICATION",
          "issueWatchersNotification"557058:aea7ac02-75c1-4f47-9beb-dd89777d4949",
 : "ENABLED"
        },
        {
          "displayNametype": "Krzysztof Bogdan"HTTP",
          "parallelGroupNumber": 1,
          "avatarUrlsname": { "webhook",
          "httpMethod": "POST",
          "48x48urlTemplate": "https://webhook.site/avatard42d1f3d-management74a8-433e-avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/48",
 b5a3-961d46505fe4?test=test",
          "headersTemplate": "Content-Type: application/json\nAccept: application/json",
          "bodyTemplate": "{\"pages\":[\"${ref.id}\"]}",
          "action": "NOTIFICATION",
          "issueWatchersNotification": "DISABLED"
        }
      ],
      "rejectionSteps": [
        {
          "type": "HTTP",
          "parallelGroupNumber": null,
          "name": "asd",
          "httpMethod": "POST",
          "32x32urlTemplate": "https://avatar2e98-management91-220-avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/32",
222-198.ngrok-free.app/connect/jira/webhook-with-message",
          "headersTemplate": "",
          "bodyTemplate": "                ",
          "action": "NOTIFICATION",
          "issueWatchersNotification": "DISABLED"
        }
      ],
      "availableForJSMCustomers": false
    },
    {
      "id": "98",
      "name": "only confluence users",
      "description": "",
      "collectionId": null,
      "steps": [
        {
  "24x24": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/24        "type": "GROUP",
          "parallelGroupNumber": null,
          "groupId": "06a60c65-1cb8-4ea8-997a-3dc3dafc6ceb",
          "action": "APPROVAL",
          "requiredVotes": 1,
          "requiredRejectVotes": 1,
          "displayName": "confluence-users",
          "approvalCreatorExcluded": true,
          "skipFromApprovalWhenEmpty": false,
          "issueWatchersNotification": "ENABLED"
        }
      ],
      "rejectionSteps": [],
      "availableForJSMCustomers": false
    }
  ],
  "totalCount": 2
}

Approval

ref-id- In the case of Approval Path for Confluence, this is page id.

List approvals

GET /approvals/{ref-id}

Return example:

Expand
titleExample response data
Code Block
languagejson
{
  "result": [
    {
      "id": "38",
      "definitionId": "35",
      "name": "Approval Name",
      "summary": "Ticket Summary",
      "collectionId": "10002",
      "refId": "10004",
     "16x16 "steps": [
        {
          "type": "USER",
          "status": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/SUCCESS",
          "userId": "557058:aea7ac02-75c1-4f47-9beb-dd89777d4949/f795c3d7-bee3-4444-9d39-0b18b81cb20b/16"",
          "displayName": "Krzysztof }Bogdan",
          "action": "STARTED",
          "decision": "ACCEPTED",
          "decisionDate": "2021-09-30T13:51:01.676+00: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
{
  "definitionId": "id",
  "summary": "Approval summary. Usually issue/page title",
  "userId": "Atlassian user id"
}

...

Reset approval

Allows the 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 the approval path is reset via API. The creator of the API will be specified as the agent.

Expand
titleExample body
Code Block
{
  "userId": "Atlassian user id"
}

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

Code Block
{
  "createComment": true,
  "userId": "Atlassian user id"
}

This will reset the path and generate a comment.

Expand
Code Block
languagejson
{
    "result": [
        {
            "id": "469",
            "definitionId": "197",
            "name": "Page content approval",
            "summary": "NDA-33 Documentation",
            "collectionId": "10000",
            "refId": "10068",
            "steps": [
                {
                    "type": "USER",
                    "status": "SUCCESS",
                    "userId": "6105b29ec51f3a0069c9ccda",
                    "displayName": "Parsa Shiva",
                    "parallelGroupNumber": null,
                    "action": "STARTED",
                    "decision": "ACCEPTED",
                    "decisionDate": "2022-09-26T15:32:42.340+00:00",
                    "lastUpdated": "2022-09-26T17:32:42+02:00"
                },
                {
                    "type": "USER",
                     "status": "SUCCESS",
                    "userId": "6105b29ec51f3a0069c9ccda",
                    "displayName": "Parsa Shiva",
                    "parallelGroupNumber": null,
                    "action": "APPROVAL",
                    "decision": "ACCEPTED",
                    "decisionDate": "2022-09-26T15:32:52.128+00:00",
                    "lastUpdated": null
                },
                {
                    "type": "USER",
                    "type": "USER",
                    "status": "SUCCESS",
                    "userId": "6299df401648f2006963deb8",
                    "displayName": "Jessica Smith",
                    "parallelGroupNumber": null,
                    "action": "APPROVAL",
                    "decision": "ACCEPTED",
                    "decisionDate": "2022-09-27T09:23:07.459+00:00",
                    "lastUpdated": null
                },
                {
                    "type": "USER",
                    "status": "SUCCESS",
                    "userId": "6299df401648f2006963deb8",
                    "displayName": "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
}