REST API: how to get table total sum value and transfer it to a custom field

REST API: how to get table total sum value and transfer it to a custom field

call was made via JMWE plugin

1. Generate API token in Admin Configuration

2. Use "Sum for field" request to get sum

https://apps.stagil.com/stjc/rest/stj/1.0/api/table/sum/customField/:customFieldId/issue/:issueIdOrKey/field/:fieldId

here you must set (set values without semicolons):

  • :customFieldId (table)

  • :issueIdOrKey (issue with table)

  • :fieldId (summing column)

How to find custom field id and fieldId :
REST API

3. Use data in callRest

{{ ":url" | callRest(options = { "auth": {"username" : "$tokenLabel@:instanceName.atlassian.net", "password": ":tokenValue" } }) | dump(2)}}

Here you must set (set values without semicolons):

  • :tokenLabel - from step 1

  • :tokenValue - from step 1

  • :url - from step 2

  • :instanceName - your instance name