[JMWE] How to sum fields on linkissue?

RIZKY JTUASIKAL
Contributor
April 29, 2024

I use the following query to sum the fields in the subtask :

1..PNG

for that query, was successfully executed.

 

 

then, I use the following query to sum the fields in the linkissue :
2..PNG

but I get the following error message:

3;.PNG

 

 

Did I miss something?

2 answers

1 accepted

2 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 29, 2024

Hi @RIZKY JTUASIKAL 

the name of the filter is linkedIssues (with an "s")

RIZKY JTUASIKAL
Contributor
April 29, 2024

Hi @David Fischer ,

 

as always, thanks for the feedback :)

but I have a question,
after adding “s” to LinkIssues, I get the following “Warning” message:

warning.PNG

What does the warning mean?
Do I need to change anything else?

RIZKY JTUASIKAL
Contributor
April 29, 2024

and one other error message:

Capture.PNG

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 30, 2024

Hi @RIZKY JTUASIKAL 

That's because you need to pass the list of fields as an array:

linkedIssues(["customfield_12529"])

 However, to be fair, I haven't tested this without passing an outside link type name as the first parameter.  

RIZKY JTUASIKAL
Contributor
May 1, 2024

Hi @David Fischer,

I tried it, and it worked!!
here's the query:

{{ targetIssue | linkedIssues(["customfield_12529"]) | sum("fields.customfield_12529") }}

and here's how it looks:

1.PNG

 

thanks to you, David!

 

RIZKY JTUASIKAL
Contributor
May 21, 2024

Hi @David Fischer ,

sorry to ask you again,
if I want to add a query so that only specific issuetype ( MoA Project ) can be processed, how can I do that?


Note:
MoA Project is a subtask


1.PNG

thank you very much in advance, David
You've helped a lot.



David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 21, 2024

Hi @RIZKY JTUASIKAL 

do you mean that only want to sum the customfield_12529 field only on the linked issues of a certain issue type? Or only calculate the value if the current issue is of a certain issue type?

Assuming the former, you can do this:

{{ targetIssue | linkedIssues(["customfield_12529", "issuetype"]) | filter(["fields.issuetype.name","MoA Project"]) | sum("fields.customfield_12529") }}
Like RIZKY JTUASIKAL likes this
RIZKY JTUASIKAL
Contributor
May 21, 2024

Hi @David Fischer ,

"do you mean that only want to sum the customfield_12529 field only on the linked issues of a certain issue type?"
>> Yes, this is the right one, and I just tried it, and it worked.

image (1).png
Thanks, David :)

RIZKY JTUASIKAL
Contributor
June 5, 2024

Hi @David Fischer ,

 

Today (June 05, 2024) I have a problem with this process,

so when I tried to replicate the process, the result is always 0, as you can see on the images below:

 

Test Nunjuck.PNG

result 0.PNG

 

But the other day when I tried to run the process,

it works perfectly and there is no error that happened that day.

 

result.PNG

history.PNG

 

 

 

and heres the query that I'm using:
Query.PNG

 

any suggestion from you, @David Fischer ? :(
Is this a bug? or did I miss something?

RIZKY JTUASIKAL
Contributor
June 5, 2024

Update: 
It turns out that JMWE had an issue last night, which caused it to not work properly.

When we tried it again,JMWE was working fine again.

RIZKY JTUASIKAL
Contributor
June 5, 2024

Hi @David Fischer ,

Sorry, I wanted to ask you again,
based on the following query:

{{ targetIssue | linkedIssues(["customfield_12529", "issuetype"]) | filter(["fields.issuetype.name","MoA Project"]) | sum("fields.customfield_12529") }}

 

 

 

What if I want to add one more filter, with a specific value of a field, will the query form be like this?

{{ targetIssue | linkedIssues(["customfield_12529","customfield_12345","issuetype"]) | filter(["fields.issuetype.name","MoA Project"]) | filter (["Pengurangan"]) | sum("fields.customfield_12529") }}

 

 

 

 

 

customfield_12345 is a field of type : Select List (Single Choice)

field.PNG

 

Thank you in advance, @David Fischer 

0 votes
PARISATO Marie-Hélène
Contributor
May 7, 2024

Hi, i'm very interrested in what you do and i would like to ask you where did you use those query ? Is there in automation rules ? 

I have to do something like that in automation rules. 

RIZKY JTUASIKAL
Contributor
May 21, 2024

Hi @PARISATO Marie-Hélène ,

 

sorry for the late reply..


Currently, I'm using Jira Misc Workflow Extensions (JMWE) workflow extension from Appfire

here's the url, if you interested :
https://marketplace.atlassian.com/apps/292/jira-misc-workflow-extensions-jmwe?tab=overview&hosting=cloud

Suggest an answer

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

Atlassian Community Events