Forums

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

How to get a filter id via jelly script?

Ops Lead
Contributor
February 13, 2012

Hi,

I want to write a jelly script to do a workflow transition similar to the example at http://confluence.atlassian.com/display/JIRA044/Jelly+Escalation .

At this script the filter id is hardcoded - how do I get the filter id by name within the jelly script?

Thank you,

Andi

2 answers

1 accepted

0 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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.
February 13, 2012

You can't get filter by name because a lot of users can create filters using the same name. SearchRequestService has a few methods to get filters by user etc. but I couldn't see any Jelly tags for that!

Ops Lead
Contributor
February 13, 2012

The args about missing uniqueness are ok, I already knew this but I needed a way to get the right id once without any programming Java... .

I found a way: I made a system backup => xml-file and searched for the right object. The id is easily pickable at the xml code. Not nice but solving the issue.

Jobin Kuruvilla [Adaptavist]
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.
February 13, 2012

You can find the id from JIRA itself. Go to 'Manage Filters' and click on a filter. You will find the id at the end of the url.

https://localhost:8080/secure/IssueNavigator.jspa?mode=hide&requestId=12613

0 votes
JamieA
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.
February 13, 2012

Filter name is not unique, and attempt to do programmatic stuff in jelly seems painful to the point of wondering why you wouldn't use groovy or another scripting language, but anyway, I'd stick with the ID.

If you want to do it you need com.atlassian.jira.issue.search.SearchRequestManager#getSearchRequestById(User user, Long id)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events