How config automation rule for Tempo ? (REST API jira server)

Alex
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 30, 2023

Hi, Atlassian community!
I have a need to automate labor planning Tempo Plan.

I started doing automation and ran into a problem.

I don’t quite understand how to copy data from JSON received in “GET” to “PUT” and thereby update the time in tempo.

Thanks for any help!

get.png

JSON result ("GET")

[
{
"id": 58748,
"assignee": {
"key": "adm_bot",
"type": "user",
"userKey": "JIRAUSER84272"
},
"planItem": {
"id": 12345,
"type": "COMPONENT",
"projectId": 0
},
"scope": {
"id": 12345,
"type": "none"
},
"commitment": 25,
"secondsPerDay": 7200,
"includeNonWorkingDays": false,
"start": "2023-10-30",
"startTime": "14:00",
"end": "2023-10-30",
"seconds": 7200,
"created": "2023-10-30",
"createdBy": "adm_bot",
"createdByKey": "JIRAUSER84272",
"updated": "2023-10-30",
"updatedBy": "adm_bot",
"recurrence": {
"endDate": "2023-10-30",
"rule": "NEVER"
},
"planApproval": {
"requester": {
"name": "adm_bot",
"key": "JIRAUSER84272",
"displayName": "ADM bot"
},
"reviewer": {
"name": "string",
"key": "string",
"displayName": "string"
},
"actor": {
"name": "adm_bot",
"key": "JIRAUSER84272",
"displayName": "ADM bot"
},
"statusCode": 1,
"latestAction": {
"key": "SUBMITTED",
"message": "submitted"
},
"updated": "2023-10-30 17:08:26",
"created": "2023-10-30 17:08:26"
}
}
]

 

in "PUT" request , i try add custom data ,something like :

put.png

Custom data*

{
"allocationId": {{webhookResponse.body.id}},
"assigneeKey": "adm_bot",
"assigneeType": "string",
"day": "2023-10-30",
"end": "2023-10-31",
"includeNonWorkingDays": false,
"partialUpdate": true,
"planItemId": {{webhookResponse.body.planItem['id']}},
"planItemType": "ISSUE",
"plannedSeconds": 0,
"secondsPerDay": 72000,
"start": "2023-10-30",
"startTime": "19:00"
}

 

My expected result: The time in TEMPO plan will be updated to 20 hours. But apparently something went wrong..

 

2 answers

1 accepted

0 votes
Answer accepted
Alex
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2023

After numerous attempts to wedge smart value into the Automation rule - "Send web request" for frame "custom data", I succeeded! The expressions (smart value) look like this.

"allocationId": {{webhookResponse.body.id}}
"assigneeKey": "{{assignee.key}}"
"planItemId": {{webhookResponse.body.planItem.id}}

+ my screen. I hope this is useful to someone

PUT.png

0 votes
Alex
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 30, 2023

Suggest an answer

Log in or Sign up to answer