REST API to get scripted field

Dikshith May 30, 2023

I have a scripted field in my instance(Jira Data center) , which fetches issues against a JQL and some calculations and display's them on the corresponding issue, I am trying to get these filtered issues that are being displayed on the issue screen using REST API methods like 

/rest/api/2/issue/{{issue.key}}

but iam not getting the issues that are supposed to be in the custom_field(scripted field)

Is there a way through REST API i can get all the issues that are populated in the scripted field 

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2023

Hi @Dikshith

Welcome to the community.

To proceed, could you please share the REST Endpoint code that you are using so I can review it and provide some feedback?

Thank you and Kind regards,

Ram

Dikshith May 30, 2023

I was using the normal endpoints like

/rest/api/2/issue?fields=customfield (scripted Field)

I was using the above endpoint to fetch the data , but doing this iam receiving the below response

{
"expand": "renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations",
"id": "10000",
"self": "http://localhost:8080/rest/api/2/issue/10000",
"key": "TEST-1",
"fields":
{
"customfield_10113":
[
{
"created": true,
"archived": false,
"subTask": false,
"editable": true
},
{
"created": true,
"archived": false,
"subTask": false,
"editable": true
},
{
"created": true,
"archived": false,
"subTask": false,
"editable": true
},
{
"created": true,
"archived": false,
"subTask": false,
"editable": true
},
{
"created": true,
"archived": false,
"subTask": false,
"editable": true
}
]
}
}

Where as i was atleast expecting to get key's of the issues from the scripted field 

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 30, 2023

Hi @Dikshith

There is not much information in the REST Response that you have shared.

As I requested in my previous comment:-

To proceed, could you please share the REST Endpoint code that you are using so I can review it and provide some feedback?

Also, what information are you trying to extract from the Scripted Field? From the description that you have provided, it seems you are using an Issue Picker. 

Are you trying to extract the Issue that has been selected from the Issue Picker?

I am looking forward to your feedback and clarification.

Thank you and Kind regards,

Ram

Suggest an answer

Log in or Sign up to answer