Stashincludebyfilepath |
---|
repoSlug | sil-script-library |
---|
branchId | refs/heads/master |
---|
projectKey | CAP |
---|
filepath | Some fields just can't be set using the regular Jira REST API, the Portfolio Parent Link is one of those fields. Fortunately, you can easily create a script that uses the Power Scripts REST Service to do the job when the Jira API can not.To start, we need to the script that will run when called by the REST Service. This script is actually very generic, any custom field can be set using a simple script like this:
Bitbucket file macro |
---|
showLineNumbers | true |
---|
title | updateCustomField.sil |
---|
url | https://bitbucket.cprime.io/projects/CAP/repos/sil-script-library/raw/API/updateCustomField.sil |
---|
showLineNumbers | true |
---|
progLang | java |
---|
applicationLink | e1651377-b920-3831-9722-2aeff6dc52cd |
---|
|
Stashincludebyfilepath |
---|
repoSlug | ?at=refs%2Fheads%2Fmaster |
---|
syntaxHighlighting | JavaScript |
---|
|
This is an example Curl script that calls the Power Scripts REST Service to run the script.
Bitbucket file macro |
---|
showLineNumbers | true |
---|
title | updateCustomField_curl.txt |
---|
url | https://bitbucket.cprime.io/projects/CAP/repos/sil-script-library |
---|
branchId | refs/heads/master |
---|
projectKey | CAP |
---|
filepath | API/updateCustomField.sil |
---|
showLineNumbers | true |
---|
progLang | java |
---|
applicationLink | e1651377-b920-3831-9722-2aeff6dc52cd/raw/API/updateCustomField_curl.txt?at=refs%2Fheads%2Fmaster |
---|
syntaxHighlighting | JavaScript |
---|
|
To customize this curl script you need to do the following:
- update the username and password with a valid user account. This is set in the beginning after the -u parameter.
- Update the Jira base URL. The address format is <your_base_url>/rest/keplerrominfo/refapp/latest/async-script/runScript.
- Make sure the name and path of the script are correct. This is set in the "code" field in the JSON data. In this example, the script is called "updateCustomField.sil".
- Update the key of the issue that will be updated. This is set in the "value" field in the JSON data. In this example, the script is called "TP-123".
- Update the custom field ID of the Parent Link field or the name of the SIL alias was set up previously. This is passed in the "args" field array in the JSON data. In this example, the ID is "customfield_12345".
- Update the key that the issue should be linked to (the parent). This is the second value in the args array. In this example, the parent link is "PORT-456".