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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.