Forums

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

ScriptRunner API reference for attributes

ian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2019

I am unable to find the appropriate API documentation to help me write ScriptRunner scripts - here's what I have so far:

As an example script, you can see that https://www.adaptavist.com/doco/display/SFJCL/How+to+use+the+Evaluate+Conditions+feature+on+Script+Listeners

shows example code

issue.issueType.name.match('^(Story)$') != null

That's understandable.  Here's my question:

Where would I discover that "issue" has an attribute/property/value named "issueType" ?  What other attributes/properties/values does "issue" have?  Where are they listed?

Where would I discover that "issueType" has the "name" property?

I'm on cloud version, and i'm used to being able to read API documentation (such as Java) that lists properties as well as methods.

I am aware of this documentation https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-group-Issues

however that doesn't comprehensively list each object's properties and they can't be inferred from the example responses.  For example, looking at the "getIssue" example and IssueBean would not have revealed that "issueType" is an available attribute of "issue" object.

2 answers

1 accepted

0 votes
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
August 20, 2019

Hi Ian,

Thank you for your question.

I can confirm that you can see the ScriptRunner for Jira Cloud documentation site located here as well as the Atlassian rest API documentation located here.

I can also confirm that as per your example above that the conditions inside of ScriptRunner for Jira Cloud are built on the expressions API which is documented here and this page shows you all attributes that an object has such as all the objects for an issue which are documented here

Finally one other tip I have to see how data is stored on fields on an issue is to navigate to the Script Console page and to run the Get Issue Fields example script which you will find in the Examples section below the code box as this will return the JSON representation of an issue to see how the data is stored in fields on an issue.

If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.

Regards,

Kristian

ian
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 17, 2019

Those appear to be the Java API documents.  I'm on Cloud, so they do not appear applicable.  The REST API responses do not align with the Java objects.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events