Forums

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

Move Task to the right column after a status update from SAP CALM API

quteiba.alsalaa April 30, 2025

I used this instruction to basically synchronise tasks, which are created in SAP CALM with Jira, i can update the Priority of task in CALM and this will be updated in Jira -> this works fine, the problem is that the Status of the task are not really updated, so when i update a status in CALM for example from In Progress to Done: Then this status is not really updated in Jira and the task is not moved to the right Column:

PS: i changed the links to XXXXX for Security

  • is this what í'm trying to achieve a possible task? this sounds yes for me -> but i can not solve it

i used Postman to get the request of what the status of the transition -> this is what i recieved:

{
    "expand": "transitions",
    "transitions": [
        {
            "id": "11",
            "name": "Backlog",
            "to": {
                "self": "XXX",
                "description": "",
                "iconUrl": "XXX",
                "name": "Backlog",
                "id": "10003",
                "statusCategory": {
                    "self": XXX",
                    "id": 2,
                    "key": "new",
                    "colorName": "blue-gray",
                    "name": "To Do"
                }
            },
            "hasScreen": false,
            "isGlobal": true,
            "isInitial": false,
            "isAvailable": true,
            "isConditional": false,
            "isLooped": false
        },
        {
            "id": "21",
            "name": "Selected for Development",
            "to": {
                "self": "XXXXX",
                "description": "",
                "iconUrl": "XXXX",
                "name": "Selected for Development",
                "id": "10004",
                "statusCategory": {
                    "self": "XXXXX",
                    "id": 2,
                    "key": "new",
                    "colorName": "blue-gray",
                    "name": "To Do"
                }
            },
            "hasScreen": false,
            "isGlobal": true,
            "isInitial": false,
            "isAvailable": true,
            "isConditional": false,
            "isLooped": false
        },
        {
            "id": "31",
            "name": "In Progress",
            "to": {
                "self": "XXXX",
                "description": "This issue is being actively worked on at the moment by the assignee.",
                "iconUrl": "XXXX",
                "name": "In Progress",
                "id": "3",
                "statusCategory": {
                    "self": "XXXX",
                    "id": 4,
                    "key": "indeterminate",
                    "colorName": "yellow",
                    "name": "In Progress"
                }
            },
            "hasScreen": false,
            "isGlobal": true,
            "isInitial": false,
            "isAvailable": true,
            "isConditional": false,
            "isLooped": false
        },
        {
            "id": "41",
            "name": "Done",
            "to": {
                "self": "XXXXX",
                "description": "",
                "iconUrl": "XXXX",
                "name": "Done",
                "id": "10005",
                "statusCategory": {
                    "self": "XXX",
                    "id": 3,
                    "key": "done",
                    "colorName": "green",
                    "name": "Done"
                }
            },
            "hasScreen": false,
            "isGlobal": true,
            "isInitial": false,
            "isAvailable": true,
            "isConditional": false,
            "isLooped": false
        },
        {
            "id": "51",
            "name": "Not Relevant",
            "to": {
                "self": "XXXX",
                "description": "This status is managed internally by Jira",
                "iconUrl": "XXXX",
                "name": "Not Relevant",
                "id": "10278",
                "statusCategory": {
                    "self": "XXXXX",
                    "id": 4,
                    "key": "indeterminate",
                    "colorName": "yellow",
                    "name": "In Progress"
                }
            },
            "hasScreen": false,
            "isGlobal": true,
            "isInitial": false,
            "isAvailable": true,
            "isConditional": false,
            "isLooped": false
        }
    ]
}
  • My External API Mapping rule in SAP CALM, looks like this, can anyone help me with that? so that i can update the task status from CALM into Jira: Done (CALM) -> Done(Jira) -> task is moved to Kanbanboard with Column Done
  • {
    "_information": {
    "_version": "REST API v3",
    "_source": "SAP Cloud ALM Task",
    "_destination": "Jira Task",
    "_name": "SAP Cloud ALM Task to Jira Task",
    "_comment": ""
    },
    "switches": [
    {
    "name": "switchType",
    "cases": [
    { "when": "CALMREQU", "then": "Requirement" },
    { "when": "CALMDEF", "then": "Defect" },
    { "when": "CALMUS", "then": "User Story" },
    { "when": "CALMTASK", "then": "Project Task" },
    { "when": "CALMTMPL", "then": "Template" }
    ],
    "default": "Project Task"
    },
    {
    "name": "switchLink",
    "cases": [
    { "when": "CALMREQU", "then": "ptmRequirement-management?sap-app-origin-hint=&tile=PTMREQ&" },
    { "when": "CALMDEF", "then": "ptmDefect-management?sap-app-origin-hint=&tile=PTMDEF&" },
    { "when": "CALMUS", "then": "task-management?sap-ui-app-id-hint=com.sap.calm.imp.tkm.ui&" },
    { "when": "CALMTASK", "then": "task-management?sap-ui-app-id-hint=com.sap.calm.imp.tkm.ui&" }
    ],
    "default": "task-management?sap-ui-app-id-hint=com.sap.calm.imp.tkm.ui&"
    },
    {
    "name": "switchPriority",
    "cases": [
    { "when": 10, "then": "Highest" },
    { "when": 20, "then": "High" },
    { "when": 30, "then": "Medium" },
    { "when": 40, "then": "Low" },
    { "when": 50, "then": "Lowest" }
    ],
    "default": "Lowest"
    },
    {
    "name": "switchStatus",
    "cases": [
    { "when": "CIPREQUINP", "then": "In Progress" },
    { "when": "CIPREQUNO", "then": "Not Relevant" },
    { "when": "CIPREQUBLK", "then": "Blocked" },
    { "when": "CIPTKINP", "then": "In Progress" },
    { "when": "CIPTKNO", "then": "Not Relevant" },
    { "when": "CIPTKBLK", "then": "Blocked" },
    { "when": "CIPTKCLOSE", "then": "Done" },
    { "when": "CIPDFCTINP", "then": "In Progress" },
    { "when": "CIPDFCTBLK", "then": "Blocked" },
    { "when": "CIPDFCTDONE", "then": "Done" },
    { "when": "CIPUSINP", "then": "In Progress" },
    { "when": "CIPUSNO", "then": "Not Relevant" },
    { "when": "CIPUSBLK", "then": "Blocked" },
    { "when": "CIPUSCLOSE", "then": "Done" }
    ],
    "default": "Open"
    },
    {
    "name": "switchTransition",
    "cases": [
    { "when": "CIPTKINP", "then": "31" },
    { "when": "CIPTKCLOSE", "then": "41" },
    { "when": "CIPTKNO", "then": "51" },
    { "when": "CIPREQUINP", "then": "31" },
    { "when": "CIPREQUNO", "then": "51" },
    { "when": "CIPREQUBLK", "then": "41" },
    { "when": "CIPDFCTINP", "then": "31" },
    { "when": "CIPDFCTBLK", "then": "41" },
    { "when": "CIPDFCTDONE", "then": "41" },
    { "when": "CIPUSINP", "then": "31" },
    { "when": "CIPUSBLK", "then": "41" },
    { "when": "CIPUSCLOSE", "then": "41" }
    ],
    "default": ""
    }
    ],
    "structure": {
    "request": {
    "fields": {
    "summary": "[SAP Cloud ALM ${SWITCH(switchType,type)}] #{title}",
    "customfield_10049": "#{id}",
    "issuetype": { "name": "Task" },
    "project": { "key": "#{@USER_VAR(projectId)}" },
    "description": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "text": "Type: ${SWITCH(switchType,type)}\n\nProject ID: #{projectId}\n\nStatus: ${SWITCH(switchStatus,status)} \n\nDescription: #{description}\n\nScope Name: #{scopeName}\n\nDue Date: #{dueDate}",
    "type": "text"
    }
    ]
    },
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "Direct Link",
    "marks": [
    {
    "type": "link",
    "attrs": {
    "href": "#{@CLOUD_ALM_URL}/launchpad#${SWITCH(switchLink,type)}/taskDetail/#{id}"
    }
    }
    ]
    }
    ]
    }
    ]
    },
    "priority": { "name": "${SWITCH(switchPriority,priorityId)}" },
    "labels": ["#{workstream}"],
    "assignee": { "accountId": "632adf49234d44d406cf77bb" }
    }
    },
    "response": {
    "displayUrl": "#{self}",
    "externalNumber": "#{key}",
    "externalId": "#{id}"
    }
    },
    "eventTypeMapping": {
    "_comment": "Specific event type mapping",
    "operationMappings": [
    {
    "eventType": "TASK.CREATED",
    "operation": "POST",
    "responseRoot": "",
    "externalIdProperty": "/id"
    },
    {
    "eventType": "TASK.UPDATED",
    "operation": "PUT",
    "responseRoot": "",
    "path": "/#{@CLOUD_ALM_EXTERNAL_ID}",
    "structure": {
    "request": {
    "fields": {
    "description": {
    "type": "doc",
    "version": 1,
    "content": [
    {
    "type": "paragraph",
    "content": [
    {
    "text": "Type: ${SWITCH(switchType,type)}\n\nProject ID: #{projectId}\n\nStatus: ${SWITCH(switchStatus,status)} \n\nDescription: #{description}\n\nScope Name: #{scopeName}\n\nDue Date: #{dueDate}",
    "type": "text"
    }
    ]
    },
    {
    "type": "paragraph",
    "content": [
    {
    "type": "text",
    "text": "Direct Link",
    "marks": [
    {
    "type": "link",
    "attrs": {
    "href": "#{@CLOUD_ALM_URL}/launchpad#${SWITCH(switchLink,type)}/taskDetail/#{id}"
    }
    }
    ]
    }
    ]
    }
    ]
    },
    "priority": { "name": "${SWITCH(switchPriority,priorityId)}" },
    "labels": ["#{workstream}"]
    }
    },
    "response": { "taskUpdated": true }
    }
    },
    {
    "eventType": "TASK.UPDATED",
    "operation": "POST",
    "path": "/#{@CLOUD_ALM_EXTERNAL_ID}/transitions",
    "responseRoot": "",
    "structure": {
    "request": {
    "transitions": {
    "id": "${SWITCH(switchTransition,status)}"
    }
    },
    "response": {
    "transitionDone": true
    }
    }
    },
    {
    "eventType": "TASK.DELETED",
    "operation": "DELETE",
    "responseRoot": "",
    "path": "/#{@CLOUD_ALM_EXTERNAL_ID}",
    "structure": {
    "request": {},
    "response": { "taskDeleted": true }
    }
    }
    ]
    }
    }

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events