Page tree
Skip to end of metadata
Go to start of metadata

Overview

Herzum Approval exposes its data via REST Application Programming Interfaces (API) which allows you to build your own integrations with the app.


API Capabilities at the moment include:

  • Search information about approval items filtering by user, status and approval name
  • Operate on the issue approvals (APPROVE, REJECT, ABSTAIN, RESET)


Authentication

The Approval API relies on the underlying JIRA Authentication mechanism and the following are supported

  • OAuth
  • Basic Auth
  • Cookie Based Authentication

For detailed information about the Authentication mechanisms please refer to Atlassian JIRA Security Documentation

In particular:


In this section

Related Documentation

Here you can find some links to our customer documentation illustrating the effect of these customizations:

Need support?

We would love to help.

Submit a support request

Using Postman

Postman is a popular tool for working with APIs. We have published a collection for testing and documentation using Postman. 

VIEW INTERACTIVE DOCUMENTATION


Download the latest version of Postman from https://www.getpostman.com/ and then click this button to import our collection:



(info) You are also able to DOWNLOAD THE COLLECTION


The collection is available from the sidebar under "Collections":


The Collection comes with various example requests, that have been set up with Collection specific variables



Get Issue Approvals

The following API is for retrieving information about items still hanging into the approval stage.


Search Issue Approvals

GET /rest/herzum-hap-services/1.0/api/issueapprovals


Parameters
NameTypeDescriptionOptionality
appnameQuery ParameterReturn only the Issues Approvals configured with the Approval with name = appnameOptional
usernameQuery ParameterReturn only the Issue Approvals for which the Jira User can actOptional
status

Query Parameter

It can be one of:

  • APPROVED
  • REJECTED
  • PENDING
  • ABSTAINED
Filter the returned Issue Approvals by statusOptional
issuekeyQuery ParameterFilter the returned Issue Approvals by issue keyOptional
issuekeysQuery ParameterFilter the returned Issue Approvals by issue keys in issuekeys setOptional
issueidsQuery ParameterFilter the returned Issue Approvals by issue ids in issueids setOptional
startAtQuery ParameterSelect the returned Issue Approvals starting from the element in position startAt. The first element has position 0Optional
maxResultsQuery ParameterLimit the number of Issue Approvals sectioned to a maximum of maxResults elementsOptional
Requests / Responses
CodeRequest

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?username=admin&status=PENDING&appname=Tech
[
    {
        "id": 13,
        "issueId": 10600,
        "approvalId": 5,
        "approvalName": "restricted",
        "issueStatus": "10001",
        "approvalStatus": "PENDING",
        "transitionId": "11",
        "transitionName": "To Do",
        "notificationDate": "Not Sent",
        "sourceStatusId": "10001",
        "type": "WORKFLOW",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1,
        "mrr": -1,
        "conditionalRuleId": -1,
        "submittedDate": "08/05/2020 13:40:53",
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false
    },
    {
        "id": 21,
        "issueId": 10500,
        "approvalId": 1,
        "approvalName": "tech",
        "issueStatus": "10001",
        "approvalStatus": "PENDING",
        "transitionId": "11",
        "transitionName": "To Do",
        "notificationDate": "Not Sent",
        "sourceStatusId": "10001",
        "type": "WORKFLOW",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1,
        "mrr": -1,
        "conditionalRuleId": -1,
        "submittedDate": "11/05/2020 10:09:18",
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false
    }
]

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekey=TEST-1
[
    {
        "id": 75,
        "issueId": 12305,
        "approvalId": 2,
        "approvalName": "Marco Polo",
        "issueStatus": "1",
        "approvalStatus": "PENDING",
        "transitionId": "11",
        "transitionName": "Start Progress",
        "notificationDate": "Not Sent",
        "sourceStatusId": "1",
        "type": "SINGLE_ISSUE",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1.0,
        "mrr": -1.0,
        "conditionalRuleId": -1,
        "submittedDate": "20/01/2023 09:59:16",
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false,
        "showAppStatusJsd": false,
        "showAppButtonsJsd": false
    },
    {
        "id": 76,
        "issueId": 12305,
        "approvalId": 3,
        "approvalName": "Roberto Pupo",
        "issueStatus": "1",
        "approvalStatus": "PENDING",
        "transitionId": "111",
        "transitionName": "Stop progress",
        "notificationDate": "Not Sent",
        "sourceStatusId": "3",
        "type": "SINGLE_ISSUE",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1.0,
        "mrr": -1.0,
        "conditionalRuleId": -1,
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false,
        "showAppStatusJsd": false,
        "showAppButtonsJsd": false
    }
]

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekeys=TEST-1,TEST-2&issueids=12500
[
    {
        "id": 75,
        "issueId": 12305,
        "approvalId": 2,
        "approvalName": "Marco Polo",
        "issueStatus": "1",
        "approvalStatus": "PENDING",
        "transitionId": "11",
        "transitionName": "Start Progress",
        "notificationDate": "Not Sent",
        "sourceStatusId": "1",
        "type": "SINGLE_ISSUE",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1.0,
        "mrr": -1.0,
        "conditionalRuleId": -1,
        "submittedDate": "20/01/2023 09:59:16",
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false,
        "showAppStatusJsd": false,
        "showAppButtonsJsd": false
    },
    {
        "id": 76,
        "issueId": 12305,
        "approvalId": 3,
        "approvalName": "Roberto Pupo",
        "issueStatus": "1",
        "approvalStatus": "PENDING",
        "transitionId": "111",
        "transitionName": "Stop progress",
        "notificationDate": "Not Sent",
        "sourceStatusId": "3",
        "type": "SINGLE_ISSUE",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1.0,
        "mrr": -1.0,
        "conditionalRuleId": -1,
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false,
        "showAppStatusJsd": false,
        "showAppButtonsJsd": false
    },
    {
        "id": 77,
        "issueId": 12400,
        "approvalId": 3,
        "approvalName": "Roberto Pupo",
        "issueStatus": "1",
        "approvalStatus": "PENDING",
        "transitionId": "11",
        "transitionName": "Start Progress",
        "notificationDate": "Not Sent",
        "sourceStatusId": "1",
        "type": "WORKFLOW",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1.0,
        "mrr": -1.0,
        "conditionalRuleId": -1,
        "submittedDate": "20/01/2023 10:02:30",
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false,
        "showAppStatusJsd": false,
        "showAppButtonsJsd": false
    },
    {
        "id": 78,
        "issueId": 12500,
        "approvalId": 3,
        "approvalName": "Roberto Pupo",
        "issueStatus": "1",
        "approvalStatus": "PENDING",
        "transitionId": "11",
        "transitionName": "Start Progress",
        "notificationDate": "Not Sent",
        "sourceStatusId": "1",
        "type": "WORKFLOW",
        "defineCustomApproval": false,
        "awt": false,
        "awtr": false,
        "awtad": false,
        "arn": false,
        "nac": false,
        "rac": false,
        "errorTransit": false,
        "mra": -1.0,
        "mrr": -1.0,
        "conditionalRuleId": -1,
        "submittedDate": "23/01/2023 10:09:38",
        "sortSa": 1,
        "sa": false,
        "saad": false,
        "abstainActionStatus": 0,
        "isOptionalApproval": false,
        "showAppStatusJsd": false,
        "showAppButtonsJsd": false
    }
]

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekeys=TEST-1,TEST-2&issueids=12500&startAt=1&maxResults=1
{
    "startAt": 1,
    "maxResults": 1,
    "total": 4,
    "issueApprovals": [
        {
            "id": 76,
            "issueId": 12305,
            "approvalId": 3,
            "approvalName": "Roberto Pupo",
            "issueStatus": "1",
            "approvalStatus": "PENDING",
            "transitionId": "111",
            "transitionName": "Stop progress",
            "notificationDate": "Not Sent",
            "sourceStatusId": "3",
            "type": "SINGLE_ISSUE",
            "defineCustomApproval": false,
            "awt": false,
            "awtr": false,
            "awtad": false,
            "arn": false,
            "nac": false,
            "rac": false,
            "errorTransit": false,
            "mra": -1.0,
            "mrr": -1.0,
            "conditionalRuleId": -1,
            "sortSa": 1,
            "sa": false,
            "saad": false,
            "abstainActionStatus": 0,
            "isOptionalApproval": false,
            "showAppStatusJsd": false,
            "showAppButtonsJsd": false
        }
    ]
}

400

Wrong Approval Name
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?appname=wrongappname
{
    "errorCode": "issueapproval.approval.notexist",
    "errorMessage": "The approval referenced by the issueApproval does not exist",
    "status": 404
}

400

Empty Approval Name
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?username=admin&status=PENDING&appname=   
{
    "errorCode": "issueapproval.appname.empty",
    "errorMessage": "If the paramenter appname is present it cannot be empty ",
    "status": 400
}

400

Wrong User Name
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?username=wronguser   
{
    "errorCode": "issueapproval.user.notfound",
    "errorMessage": "The user does not exists",
    "status": 404
}

400

Empty User Name
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?username=      
{
    "errorCode": "issueapproval.username.empty",
    "errorMessage": "The username cannot be empty",
    "status": 400
}

400

Wrong Status
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?status=WRONGSTATUS      
{
    "errorCode": "issueapproval.status.notexist",
    "errorMessage": "The specified status does not exist. Use APPROVED, REJECTED, ABSTAINED, PENDING",
    "status": 400
}

400

Empty Status
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?status=   
{
    "errorCode": "issueapproval.status.empty",
    "errorMessage": "If the paramenter status is present it cannot be empty ",
    "status": 400
}

404

Approval does not exist
{
    "errorCode": "issueapproval.approval.notexist",
    "errorMessage": "The approval referenced by the issueApproval does not exist",
    "status": 404
}

400

Empty Issue Key
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekey=   
{
    "errorCode": "issue.keys.empty",
    "errorMessage": "If the issuekey parameter is present it cannot be empty",
    "status": 400
}

404

Wrong Issue Key
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekey=wrongIssueKey
{
    "errorCode": "issue.notexist.or.noperm",
    "errorMessage": "The issue does not exist or you do not have permission to view it. Invalid issue key set: (wrongIssueKey).",
    "status": 404
}

400

Empty Issue Keys
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekeys=
{
    "errorCode": "issue.keys.empty",
    "errorMessage": "If the issuekeys parameter is present it cannot be empty",
    "status": 400
}

400

Empty Issue Ids
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issueids=
{
    "errorCode": "issue.ids.empty",
    "errorMessage": "If the issueids parameter is present it cannot be empty",
    "status": 400
}

404

Wrong Issue Keys and Issue Ids
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?issuekeys=wrongIssueKey, wrongIssueKey2&issueids=wrongIssueId, wrongIssueId2
{
       "errorCode": "issues.notexist.or.noperm",
       "errorMessage": "Some issues do not exist or you do not have permission to view them. Invalid issue key set: (wrongIssueKey,wrongIssueKey2). Invalid issue id set: (wrongIssueId,wrongIssueId2).",
       "status": 404
}

400

Empty Start At
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?startAt=
{
    "errorCode": "start.at.empty",
    "errorMessage": "If the startAt parameter is present it cannot be empty",
    "status": 400
}

404

Wrong Start At
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?startAt=WrongStartAt
{
    "errorCode": "invalid.start.at",
    "errorMessage": "startAt parameter is invalid",
    "status": 404
}

400

Empty Max Results
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?maxResults=
{
    "errorCode": "max.results.empty",
    "errorMessage": "If the maxResults parameter is present it cannot be empty",
    "status": 400
}

404

Wrong Max Results
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals?maxResults=WrongMaxResults
{
    "errorCode": "invalid.max.results",
    "errorMessage": "maxResults parameter is invalid",
    "status": 404
}

402

Invalid License
{
	"errorCode": "license.invalid",
	"errorMessage": "License is invalid",
	"status": 402
}


Act on Requested Approvals

The following API is for performing operations on the items still hanging into the approval stage.


Operate on Issue Approval

POST /rest/herzum-hap-services/1.0/api/issueapprovals/{approvalId}/action


Parameters
NameTypeDescriptionOptionality
approvalIdPath ParameterThe id of the IssueApproval we want to operateMandatory
ActionRequestBodyParameter

Example

{
	"action"   : "APPROVE",
	"username" : "username", 
	"password" : "password" ,
	"comment" : "comment"
}
Optional
actionPart of Action RequestIt can be one of APPROVE, REJECT, ABSTAIN, RESETMandatory
usernamePart of Action RequestThe username of the current logged in user

Optional**

It can be required if configured into Approval Configuration

passwordPart of Action RequestThe password of the current logged in user

Optional**

It can be required if configured into Approval Configuration

commentPart of Action RequestThe comment to be set with the approval action

Optional**

It can be required if configured into Approval Configuration

Requests / Responses
CodeRequest

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "Name", 
	"password" : "Pwd" ,
	"comment" : "comment"
}

Response

{
    "id": 11,
    "issueId": 10500,
    "approvalId": 3,
    "issueStatus": "10001",
    "approvalStatus": "APPROVED",
    "date": "08/05/2020 15:24:28",
    "approverUser": "admin",
    "transitionId": "21",
    "transitionName": "In Progress",
    "notificationDate": "Not Sent",
    "sourceStatusId": "10001",
    "type": "WORKFLOW",
    "defineCustomApproval": false,
    "awt": false,
    "awtr": false,
    "awtad": false,
    "arn": false,
    "nac": false,
    "rac": false,
    "errorTransit": false,
    "mra": -1,
    "mrr": -1,
    "conditionalRuleId": -1,
    "submittedDate": "08/05/2020 12:43:52",
    "sortSa": 1,
    "sa": false,
    "saad": false,
    "abstainActionStatus": 0,
    "isOptionalApproval": false
}

400

WRONG ACTION
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "WRONG",
	"username" : "Name", 
	"password" : "Pwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.action.notexist",
    "errorMessage": "The specified action does not exist. Use APPROVE, REJECT, ABSTAIN, RESET",
    "status": 400
}

400

WRONG issueApprovalId
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/214124214/action

Request

{
	"action"   : "APPROVE",
	"username" : "adminName", 
	"password" : "adminPwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.notexist",
    "errorMessage": "The specified issueApproval does not exist",
    "status": 404
}

404

WRONG username
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "userdoesnotexist", 
	"password" : "adminPwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.user.notfound",
    "errorMessage": "The user does not exists",
    "status": 404
}

403

Username and Password mismatch
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "user", 
	"password" : "wrongpwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.credentials.wrong",
    "errorMessage": "The username and the password do not match",
    "status": 403
}

403

Username different than loggedin user
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "differentusername", 
	"password" : "pwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "username.notcorrespond",
    "errorMessage": "The username does not correspond to the loggedin user",
    "status": 403
}

403

Action not allowed or the user does not have permission
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "username", 
	"password" : "pwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.action.unauthorized",
    "errorMessage": "The user cannot perform the required action",
    "status": 403
}

400

Action Required
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"username" : "username", 
	"password" : "pwd" ,
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.action.required",
    "errorMessage": "The action parameter is required",
    "status": 400
}

400

Password Required by configuration
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.pwd.required",
    "errorMessage": "The password is required by the General Configuration",
    "status": 400
}

400

Username Required by configuration
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"password"   : "password",
	"comment" : "comment"
}

Response

{
    "errorCode": "issueapproval.username.required",
    "errorMessage": "The username is required by the General Configuration",
    "status": 400
}

400

Comment Required by configuration
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "username", 
	"password" : "pwd"
}

Response

{
    "errorCode": "issueapproval.comment.required",
    "errorMessage": "The comment is set to be required by Configuration",
    "status": 400
}

403

Forbidden Action on OWls Issue Approvals
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "username", 
	"password" : "pwd"
}

Response

{
    "errorCode": "issueapproval.action.owls",
    "errorMessage": "Action on configuration issueApprovals (OWLs) are on allowed",
    "status": 400
}

403

Action disabled by configuration
http://{{hostname}}/rest/herzum-hap-services/1.0/api/issueapprovals/11/action

Request

{
	"action"   : "APPROVE",
	"username" : "username", 
	"password" : "pwd"
}

Response

{
    "errorCode": "issueapproval.action.disabled",
    "errorMessage": "The action is disabled by Configuration",
    "status": 403
}

402

Invalid License
{
	"errorCode": "license.invalid",
	"errorMessage": "License is invalid",
	"status": 402
}


Bulk operations for Approval mapping

The following API performs bulk operations such as delete, copy, move, and edit on the Approval mapping configuration.

The feature is available in Approval plugin version 6.9 and later.

This REST service allows you to perform the same bulk operations as the plugin's graphical interface:

For execution limitations, see

Bulk Operations - Herzum Approval Documentation - Herzum's Confluence

Bulk operations

POST/rest/herzum-hap-services/1.0/api/bulk-mapping-operation

Parameters

Bulk operations on projects 

NameTypeDescriptionOptionality
ActionRequestBodyParameter

Example

{"action": "copy",
 "type": "project",
 "projectId": "10100",
 "mappingList": [
   {"projectId": "10101"},
   {"projectId": "10200"}]
}
Mandatory
actionPart of Action RequestIt can be one of delete, copy, move, editMandatory
typePart of Action RequestOperation type = 'project'

Mandatory

projectIdPart of Action RequestThe source project ID whose mapping configuration you want to copy to unmapped transitions, move to unmapped transitions, or use to update existing mapped transitions

Mandatory

mappingListPart of Action RequestList of destination project IDs whose approval mapping configurations are to be updated.

Mandatory

Bulk operations on workflows

NameTypeDescriptionOptionality
ActionRequestBodyParameter

Example

{"action": "copy",
 "type": "project-issuetype",
 "projectId": "10100",
 "issueTypeId": "10002",
 "mappingList": [
   {"projectId": "10101", "issueTypeId": "10003"},
   {"projectId": "10200", "issueTypeId": "10003"}]
}
Mandatory
actionPart of Action RequestIt can be one of delete, copy, move, editMandatory
typePart of Action RequestOperation type = 'project-issuetype

Mandatory

projectId

issueTypeId

Part of Action RequestThe source project ID and the issuetype ID which identify the source workflow whose mapping configuration you want to copy to unmapped transitions, move to unmapped transitions, or use to update existing mapped transitions

Mandatory

mappingListPart of Action RequestList of (destination project ID, issuetype ID) IDs which identify the destination workflow whose approval mapping configuration is to be updated.

Mandatory

Bulk operations on transitions

NameTypeDescriptionOptionality
ActionRequestBodyParameter

Example

{"action": "copy",
 "type": "project-issuetype-status-trans",
 "projectId": "10100",
 "issueTypeId": "10002",
 "sourceStatusId": "1", 
 "transitionId": "11"
 "mappingList": [
   {"projectId": "10101", "issueTypeId": "10003", "sourceStatusId": "1", "transitionId": "11"},
   {"projectId": "10200", "issueTypeId": "10003", "sourceStatusId": "1", "transitionId": "11"}]
}
Mandatory
actionPart of Action RequestAction: It can be one of delete, copy, move, editMandatory
typePart of Action RequestOperation type = 'project-issuetype-status-trans

Mandatory

projectId

issueTypeId

sourceStatusId

transitionId


Part of Action RequestThe project ID, the issuetype ID, the status ID and the transition ID  which identify the source transition whose mapping configuration you want to copy to unmapped transitions, move to unmapped transitions, or use to update existing mapped transitions

Mandatory

mappingListPart of Action RequestList of (project ID, issuetype ID, status ID, transition ID) IDs which identify the destination transitions whose approval mapping configuration is to be updated.

Mandatory

Delete operation

NameTypeDescriptionOptionality
ActionRequestBodyParameter

Example

{"action": "delete",
 "type": "project",
 "mappingList": [
   {"projectId": "10101"},
   {"projectId": "10200"}]
}
Mandatory
actionPart of Action RequestAction = deleteMandatory
typePart of Action RequestOperation type = 'project'

Mandatory

mappingListPart of Action RequestList of destination project IDs whose approval mapping configurations are to be deleted.

Mandatory

Requests / Responses
CodeRequest

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/bulk-mapping-operation

Request

{"action": "copy",
 "type": "project",
 "projectId": "10100",
 "mappingList": [
   {"projectId": "10101"},
   {"projectId": "10200"}]
}

Response

{
    "operation""COPY",
    "affectedEntries"2,
    "skippedOperations"0
}

NameDescription
operationaction performed = copy
affectedEntriesunmapped transitions updated
skippedOperationsnumber of transitions not updated because they are already mapped

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/bulk-mapping-operation

Request

{"action": "move",
 "type": "project",
 "projectId": "10100",
 "mappingList": [
   {"projectId": "10101"},
   {"projectId": "10200"}]
}

Response

{
    "operation": "MOVE",
    "affectedEntries": 4,
    "skippedOperations": 2,
    "warning": "2 move operations were skipped because the destination transitions were already mapped before the move operation began."
}

200

Successful Request
http://{{hostname}}/rest/herzum-hap-services/1.0/api/bulk-mapping-operation

Request

{"action": "edit",
"type": "project-issuetype",
"projectId": "10101",
"issueTypeId": "10002",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003"}
]}

Response

{
    "operation": "EDIT",
    "affectedEntries": 3,
    "skippedOperations": 1,
    "warning": "An edit operation was skipped because the destination transition was not mapped before the edit operation began."
}

200

Successful Request

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10100",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"},
]}

Response

{
    "operation": "COPY",
    "affectedEntries": 2,
    "skippedOperations": 0
}

200

Successful Request

Request

{"action": "delete",
"type": "project",
"mappingList": [
{"projectId": "10100"}
]}

Response

{
    "operation": "DELETE",
    "affectedEntries": 2,
    "skippedOperations": 0
}

400

The project does not exist

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10108",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.project.notexist",
    "errorMessage": "The project (Id 10108) does not exist.",
    "status": 400
}

400

The issuetype does not exist

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "30002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

The issuetype does not exist.

{

    "errorCode""bulk.mapping.issuetype.notexist",
    "errorMessage""The issuetype (Id 30002) does not exist.",
    "status"400
}

400

Source Status does not exist

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1111", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.status.not.exist",
    "errorMessage": "Source Status (Id 1111) does not exist in the Workflow TEST: Process Management Workflow for the Project DOUB and IssuType (Id 10002).",
    "status": 400
}

400

Transition is not related to the status 

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "3100"}
]}

Response

{
    "errorCode": "bulk.mapping.transition.id.invalid",
    "errorMessage": "Transition (Id 3100) is not related to the status Under Review (Id 10000) for project (Id 10100) and issueType (Id 10003).",
    "status": 400
}

400

The action parameter is required

Request

{"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.action.required",
    "errorMessage": "The action parameter is required",
    "status": 400
}

400

The specified action does not exist

Request

{"action": "clone",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.action.notexist",
    "errorMessage": "The specified action does not exist. Use copy, move, delete, edit",
    "status": 400
}

400

The operation type parameter is required

Request

{"action": "copy",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.operation.type.required",
    "errorMessage": "The operation type parameter is required",
    "status": 400
}

400

The specified operation type does not exist

Request

{"action": "copy",
"type": "project-workflow",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.operation.type.notexist",
    "errorMessage": "The specified operation type does not exist. Use project, project-issuetype, project-issuetype-status-trans",
    "status": 400
}

400

The project id parameter is required

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.project.id.required",
    "errorMessage": "The project id parameter is required",
    "status": 400
}

400

The issuetype id parameter is required

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.issuetype.id.required",
    "errorMessage": "The issuetype id parameter is required",
    "status": 400
}

400

The status id parameter is required

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "10002",
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.status.id.required",
    "errorMessage": "The status id parameter is required",
    "status": 400
}

400

The transition id parameter is required

Request

{"action": "copy",
"type": "project-issuetype-status-trans",
"projectId": "10101",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"mappingList": [
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "131"},
{"projectId": "10100","issueTypeId": "10003","sourceStatusId": "10000", "transitionId": "31"}
]}

Response

{
    "errorCode": "bulk.mapping.transition.id.required",
    "errorMessage": "The transition id parameter is required",
    "status": 400
}

400

The source project has a different workflow scheme than destination project

Request

{"action": "copy",
"type": "project",
"projectId": "10000",
"mappingList": [
{"projectId": "10100"}
]}

Response

{
    "errorCode": "bulk.mapping.workflow.schemes.not.equals",
    "errorMessage": "The source project (id=10000)  has a different scheme than destination project (id=10100)",
    "status": 400
}

400

The source workflow is not the same as the destination workflow

Request

{"action": "copy",
"type": "project-issuetype",
"projectId": "10000",
"issueTypeId": "10002",
"sourceStatusId": "1", 
"transitionId": "11",
"mappingList": [
{"projectId": "10100","issueTypeId": "10003"}
]}

Response

{
    "errorCode": "bulk.mapping.workflow.not.equals",
    "errorMessage": "The source workflow associated with the project (id = 10000) and issuetype (id = 10002) is not the same as the destination workflow  associated with the project (id = 10100) and issuetype (id = 10003)",
    "status": 400
}




  • No labels