Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner Cloud return system fields

Wade Hephner September 16, 2020

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

1 answer

1 accepted

0 votes
Answer accepted
Wade Hephner September 16, 2020

well this was way easier than i imagined, lol.

def summary = fields.summary did the trick

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events