Forums

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

Using filter in an automation rule to filter out specific issues

Rghiya April 4, 2024

Hello,

I have created a filter using a "ScriptRunner Enhanced Search" for a query that cannot be handled by a regular JQL. I need to copy a field in issues listed by this filter from some other issues. How do I use a filter in "condition" component of an automation rule?

 

For more details:

I have epics in project P1 linked to epics in Project P2. I want to change a field in epics in project P1 when the same field is changed in the linked epic in project P2. I have used scriptrunner to create a filter which lists where all P1 epics have epics linked in P2. 

Thank you for your time and consideration!

 

2 answers

2 votes
Joaquin Fernández Morales
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.
April 12, 2024

Hi @Rghiya 

I can confirm that if you want to use issueFunction you will need to create an Enhance Search filter but you can only use the ES function provided by ScriptRunner on the Enhanced Search page.

However, this does not mean that they cannot be used inside other filters or outside the ES page ( for example an automatin rule ). To do that, 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 by 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 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>"
  4. Save your JQL search in an standard Jira filter and use it where you need it. 

I hope it helps. 

Regards,

Joaquin F. 

Rghiya April 12, 2024

 I will try that out. Thank you!

0 votes
Bill Sheboy
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.
April 4, 2024

Hi @Rghiya 

From what you describe, I do not believe you need any extended JQL capabilities provided by the addon.

Instead, a multiple-project scope automation rule could be triggered on a change to the field in one project, and then branch to the linked issues in the other project to make updates.

Kind regards,
Bill

Rghiya April 4, 2024

Hello Bill,

Thank you for the reply but normal jql does not allow "issueFunction in linkedIssuesOf" function in our Jira instance. This function allows for filtering out issues from P1 that have a link in P2. As not all P2 havelink in P1. 

Let me know if you meant something else. 

 

Thanks!

Bill Sheboy
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.
April 4, 2024

When an issue has a direct link to another issue, either can be accessed by the links using the built-in features of JQL (and automation rules). 

You described Epics in one project are linked to Epics in another project, and so what I suggested should work.  

Are you instead trying to find issues which are not directly linked?  For example, the child issues of the linked issues.

Rghiya April 5, 2024

Hi Bill,

I am looking at the value of particular field of the linked issue something like a status, or due date of the linked epic. Please let me know the built-in Jira function for doing this. 

Thanks!

Bill Sheboy
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.
April 5, 2024

Please try the branch on linked issues, selecting the link types needed.  If you need to filter further on a field, add a rule condition.

If that does not help, please post:

  • an image of your complete rule;
  • images of the trigger, actions, conditions, and branches;
  • an image of the audit log details showing the rule execution; and
  • explain what is not working as expected.

Those will provide specific context for the community to offer suggestions.

Suggest an answer

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

Atlassian Community Events