Hello all, can anyone point me in the right direction to return system fields such as summary and description in a Scriptrunner cloud script? I can get custom fields easily enough using this:
def issueKey = "SD-44"
def issue = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
.body
def fields = issue.fields as Map
def product = get("/rest/api/2/field")
.asObject(List)
.body
.find {
(it as Map).name == 'Product'
} as Map
def productValue = (fields[product.id] as Map)?.value
return "The value of ${product.name} custom field is: ${productValue}"
however for system fields I have not been able to figure out how to return the values.
Thanks you in advance for your time.
-wade
well this was way easier than i imagined, lol.
def summary = fields.summary did the trick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.