Forums

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

Sort issues in one project by a field from another project jira

MGMKLML
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 29, 2022

I have the following use case:

  1. I have two company-managed projects, let's call them `AA` and `BB`
  2. Let's suppose that the project `BB` has a custom field called `Total sum`. 
  3. Let's suppose that some of the issues from the `AA` project are linked with some issues from the `BB` project.

I would like to build the following JQL:

Find all issues in the project AA that are linked with issues BB and sort these issues from AA in the descending/ascending order of the "Total sum" field from the BB project. If there are multiple links to one issue from AA then take the highest value of the "Total sum" field from the links.


Example:

  1. Links:
    1. Issue AA-2 is linked with BB-5 and BB-6
    2. Issue AA-4 is linked with BB-4
    3. Issue AA-8 is linked with BB-5 and BB-7
  2. "Total sum" values:
    1. BB-4 -> 25
    2. BB-5 -> 20
    3. BB-6 -> 38
    4. BB-7 -> 31
  3. Suppose I want to list AA issues in the descending order. So the expected result of the search query should be issues from AA in the following order:
    1. AA-2
    2. AA-8
    3. AA-4

P.S. If it is achievable through some extensions/plugins apart from leveraging the Jira's API manually to build the sorting mechanism, feel free to recommend such extensions.

1 answer

0 votes
Clark Everson
Community Champion
June 29, 2022

Hi @MGMKLML 

Welcome to community!

I don’t believe natively this is possible.

however this can be achieved via scriptrunner as you would need to make some scripted fields and also use scriptrunners advanced JQL to do this

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html

best,

clark

MGMKLML
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 29, 2022

Hi @Clark Everson ,  

Thank you for your response! I tried it and I failed to achieve any result. Do you think it is possible to build a test example for me?

Clark Everson
Community Champion
June 30, 2022

Hi @MGMKLML 

Unfortunately no. I do not have a cloud instance with scriptrunner.  Usually in situations where you are testing out a plug-in if you need a demo I would recommend reaching out to the plug in/app vendor and explain your use case. They often can make a demo for you

You can contact adaptivist here: https://www.adaptavist.com/contact

Suggest an answer

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

Atlassian Community Events