Dear ALL,
I understand that a work-around about the current Jira DC lookup limitation over custom fields is to code an automation rule with When=Scheduled and then select the bulk option.
My question is: given that (the automation rule), is there a way now to store the same/specific custom field of all the issues coming from the applied JQL in a variable?
So, I can use these variables later on in the automation rule in order to make calculation?
As you can see below, I have used this syntax {{issues.get(0).fields.customfield_19141}} but it gives (as expected, I think) the values of all the issues found (in this case 2):
I use Jira DC version 9.12.24.
Thanks, Vincenzo.
First regarding the limited fields in Lookup Issues in Jira Server or Data Center automation, there are two possible workarounds...depending upon needs / context:
Next, I am unclear what you are trying to accomplish for your scenario. Perhaps you could try explaining it again. Thanks!
Finally, from your other post about lookup tables, one workaround would be using the dynamic list searching methods I describe in this article. For example:
Kind regards,
Bill
Thanks @Bill Sheboy,
I would like to calculate the mean average of all the completion field values coming from all the JQL issues.
In my example, the total of issues is 2, completion value for issueA is 40 and completion value for issueB is 30.
I have applied then the workaround as described in the article you posted but I can get only the value of the first issue and not of the second: that's the meaning of the workaround being partial? Working only for the first issue?
See please below:
Thanks a lot,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for that information, @vincenzo_spatafora
What do you want to do with that mean (i.e. arithmetic average) value?
Let's assume you only want to calculate it, such as for sending in a message. That is quite simple:
{{issues.customfield_19141.average}}
If instead you wanted to save the average in another field, another technique is required in order to both get the issue data and then update some other issue (perhaps with a branch), using the Send Outgoing Web Request action.
{{webhookResponse.body.customfield_19141.average}}
I am not using Jira Data Center, so please confirm the specific endpoint and response structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to confirm...did that solve this question for you? If so, please consider marking this one as "answered". That will help others with a similar need find solutions faster. If not, please let the community know what help you need with the rule.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy,
I haven't tried the send web request.
About the first technique, I have tried it and
{{issues.customfield_19141.average}}gives me no value.
Then I have stopped investigating further as I understand Jira DC will be decommissioned.
Thanks a lot anyway for your great assistance,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @arielei , thanks for your message.
Yes, I have this option, so, what am I supposed to do now?
Thanks in advance,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, since you are running a branch on JQL, remove the JQL from the trigger, and add it to the JQL branch.
Before doing the branch, create a variable with value NULL and then in the branch, create the same variable again and set the value from the issue.
give it a try.
Ariel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @arielei.
Do you mean something like this:
As you can see, it gives me the sum of itsself.
How can I store the single value such that the sum is (in this example) 70?
And on 70 I need to work out then the mean avearge, so, in this case 35.
Thanks, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First, set the Completion before the branch to "0" instead of Null.
Then, inside the branch when you create the var write:
{{#=}}{{Completion}} + {{issue.Completion}}{{/}}
Note - {{issue.Completion}} is the value from the issue - i guess that is what you are doing in the var.
Let me know if that works.
Ariel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @arielei
I check now, and by the way, how can I get the number of issues given by the JQL?
In this case, 2.
I need it to make later on in the automation rule the average of 30 and 40.
Thanks, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you have an action called "Lookup issues" then simply do Lookup issues on that JQL and then you can get the size by {{lookupIssues.size}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @arielei,
but that's the underlying problem: the lookup function is NOT working for custom fields; if it were, it would have been very easy to code an automation rule working out the completion average of a bunch of issues.
So, now, are you suggesting to use in my automaiton rule either the lookup and branch for JQL?
Thanks in advance,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So @arielei,
here what I have done and still not working.
Where is the error?
Where the var Completion is this smart value : {{issue.fields.customfield_19141}}; in the first "And: Create variable".
While in the second "And: Create variable" I set Completion to 0 (as smart value).
Thanks a lot,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ping me via linkeding and lets jump on a call and i'll try to assist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @arielei for that but I can NOT share my screen.
What is unclear for you about what I have described and attached so far?
Cheers, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @vincenzo_spatafora
i dont need to see your screen, i just need some info on what you are staying to achieve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @arielei
thanks for your patience.
What I would like to achieve is to calculate the mean average of all the completion field values coming from all the JQL issues.
So, if the JQL is giving me 2 issues, I would like to make the mean average of the completion value coming from issue 1 and coming from issue 2.
In my example, it would be (30 + 40) / 2, so 35.
But as reported above, I struggle to find a way to store in a variable each of the single completion (completion from issue 1 and completion from issue 2) such that then later on I can use them in the automation rule to do their sum (in this example 30 + 40) and divide (in this example by 2).
I really would like to know if this is possible in Jira DC (I understand this is possible with Jira Cloud by simply using the lookup function which is working also with the custom fields; my completion field is right a custom field).
Thanks in advance, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @vincenzo_spatafora
I understand,
So like i wrote above:
1. create a var outside the branch with value 0.
2. create a var that holds the number of issues by doing lookupissue on the JQL.
2. inside the branch, create the same var but the value will be
{{#=}}{{VAR NAME}} + {{issue.Completion}}{{/}}
3. after the branch, simply do
{{#=}}{{VAR NAME}}/{{lookupissue.size}}{{/}}
In DC that should work.
Let me know.
Ariel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @arielei.
I've done that but it seems not working:
1. (outside the branch)
2. (inside the branch)
And here what I get:
Thanks in advance, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the custom field is a number field, try doing this:
Remove the branch and instead create the var after the lookupissues and give it the value: {{lookupIssues.CUSTOM_FIELD.sum}}
check if that works,
Ariel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @arielei,
thanks and Completion for me is a Select List (single choice).
What would it be the lookup syntax in this case?
Cheers, Vincenzo.
P.S.:
a) can JSON advanced fied editing solve this puzzle?
b) is lookup table available for Jira DC?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @vincenzo_spatafora
a) you can use the JSON advanced field with the same method as i wrote above.
b) lookup table is not available in DC, only in Cloud.
Try to add ".asNumber" to the var you are creating, for example {{issue.Completion.asNumber}}
best regards,
Ariel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @vincenzo_spatafora ,
sorry to hear that, i suggest that you will start thinking on migrating to cloud as DC is EOL.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.