Using saved search in the workflow search function

Hi,

I am trying to use a saved search in the YT workflow using the search function, but I am getting wrong issues out of it. The usage looks like this:

return search.search(issue.project, "#{Current Sprint}")
where the Current Sprint is the saved search. When I use this search in the YT search bar I get correct list of issues. When used in the workflow I get totally different issues. I also tried not to specify the project - using null instead, but the result is the same.
 
It looks to me almost like the saved search is not visible to the workflow. Is there any setting or something to be done in order to uses the saved search in the workflow?
 
Thank you for your response.
 
Lukas
 
3 comments
Comment actions Permalink
Official comment

Hello,

The result may be different because the workflow search works on behalf of the system user. Would you please try to specify your required user as the third parameter of the search method and compare the result?

 
Comment actions Permalink

Hi Oleg,

thank you for your reaction. Specifying the user helped. I used

entities.User.findByLogin("my.login")

to look up the user. However, this is a bit inconvenient as we don't have a service account that I could specify and I have to use a real employee. That can cause problems in case the employee leaves the company and the account gets deleted/blocked.

Is there any option to make saved searches available to the system user?

Thank you and have a nice day

Lukas

0
Comment actions Permalink

In general, if you do not specify the user in the search method, all the issues are should be visible for search independently of the visibility settings. Alternatively, you can use the System Admin account to perform a search. 

I hope this helps. 

0

Please sign in to leave a comment.