Created
September 4, 2022 11:00
-
-
Save reikjarloekl/567a64667ddaa90633d8084924d79358 to your computer and use it in GitHub Desktop.
Jira Cloud ScriptRunner - Scripted field filled with asset category taken from linked asset issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def assetKey = issue.fields?.issuelinks?.find{it.type.name == "Affected asset"}?.outwardIssue?.key | |
if (assetKey == null) return "No asset linked" | |
def assetIssue = Unirest.get("/rest/api/2/issue/" + assetKey).asJson().getBody().object | |
return Optional.ofNullable(assetIssue.fields.customfield_10267?.find{true}?.value).orElse("No category set") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment