[Jira Cloud] Jira REST API for ScriptRunner Enhanced Search Function

jacob cheng November 4, 2024

We used to call Jira REST API in Jira Data Center version for ScirptRunner query function like 

 

issueFunction in subtasksOf("status in ('Sprint Complete') ")

However after migration to Jira Cloud, issueFunction has been moved to ScriptRunner Enhanced Search App, and previous API call cannot work for it.

Is there any solution in Cloud for how to script/program such kind of query? 

Thanks.

2 answers

2 accepted

1 vote
Answer accepted
Marios Marneros
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2024

Hey @jacob cheng

Have you tried creating a filter in ScriptRunner Enhanced Search ? Once you create a filter you can call the REST api for searching issues and use filter = <filter-id> in the request!

Let me know if this works and please accept my answer if it was helpful! Have a great rest of your day.

jacob cheng November 11, 2024

thank you @Marios Marneros . that works.

0 votes
Answer accepted
Kristian Walker _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.
November 4, 2024

Hi Jacob,

I can confirm that in Jira Cloud you can only use the issueFunction() JQL function provided by ScriptRunner on the Enhanced Search page as described in the documentation here.

This is because Atlassian restricts how the JQL functions can interact with their infrastructure, meaning we must run them in a sandbox process.

However, this does not mean they cannot be used inside other filters or on filters for Agile boards or in calls to the Search rest API.

To use the functions in other filters, you may follow the steps outlined below.

  1. Navigate to the enhanced search page and construct the filter you require using the JQL functions provided bv ScriptRunner.
  2. Save your filter and share it with the users that are required to be able to see it.
  3. Create the JQL search used by your board filter or quick filter and reference the saved filter using the syntax shown below which will return the results of your filter using the JQL functions provided by ScriptRunner.

    filter = "<NameOfFilterHere>"

Using this approach, you will be able to use your filter in agile boards or in calls to the Search API.

I hope this helps.

Regards,

Kristian

jacob cheng November 11, 2024

thank you @Kristian Walker _Adaptavist_ . that works fine.

Kristian Walker _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.
November 11, 2024

I am glad this works and solves your issue :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events