I want to sum values of two custom fields and save it in the third field.
When i write the rule like this
{ "fields": { "Total Effort": { "value": {{#=}}{{issue.customfield_10121}} + {{issue.customfield_10126}}{{/}} } } }
I get the error:
(Specify a number for the custom field (below 100,000,000,000,000) (customfield_10120))
if i write it like this:
{ "fields": { "customfield_10120": {{#=}}{{issue.customfield_10121}} + {{issue.customfield_10126}}{{/}} }
i get the error:
Error while parsing additional fields. Not valid JSON.
The custom fields are of datatype number
Hi @visby8em ,
Can you try using math expression directly in the field within Edit issue action (I'm assuming you're using this one?), and not necessarily advanced edit part of the action?
For example, if the third field is also number type (where you're summing previous two values), automation could look something like in the picture above.
You could just use the expression
{{#=}}{{issue.customfield_10121}} + {{issue.customfield_10126}}{{/}}
and it should work.
If it doesn't, could you please provide screenshots of your rule together with audit log of error messages you receive?
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried to add days to a date and it didnt return an error but ofc the result isnt correct
-Expiration Date = Start Date: {{issue.description.substringAfter("This started at ").substringBefore(" ")}} + Remaining Days: {{issue.description.substringAfter("is expiring in ").substringBefore(" days")}}
which is
-Expiration Date = Start Date: 2025-01-18 + Remaining Days: 44.9999 -Expiration Date = Start Date: 2025-01-18 + Remaining Days: 44.9999
{{#=}}{{issue.description.substringAfter("This started at ").substringBefore(" ")}} + {{issue.description.substringAfter("is expiring in ").substringBefore(" days")}}{{/}}
it gives this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mohamed Eid
Would you mind sharing an example of a description here so I could test it out (can contain a dummy string; not necessarily a production one)? Also, please do share images of the rule together with the audit log (especially if you're using Log action to capture smart values and other outputs).
Also, I believe that the issue is this part of 'remaining days'? In the example, instead of 44.9999 it should be 50.0?
Btw, this parsing of textual fields can be a bit tricky, as it's expected that the field will always be in the same format.
If you like, you could also open a new question or a separate thread so we don't clutter this one.
Cheers,
Tobi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Tomislav Tobijas I have created a separate post already called do calculation please have a look
also for more details i ll post this
Log action: Start Date: {{issue.description.substringAfter("This started at ").substringBefore(" ")}} Remaining Days: {{issue.description.substringAfter("is expiring in ").substringBefore(" days")}}
{{#debug}} {{ startdate("yyyy-MM-dd").plusDays(remainingdays.asNumber)}} {{/}}
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.
@Mohamed Eid let's just continue this in a separate thread (or even better, a separate post/question) so we don't create clutter here. I'll monitor the discussion that Vishal opened and jump in there if I can help.
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.
As suggested on the other post, .toDate is missing
try with this corrected statement:
{{#debug}} {{ startdate.toDate("yyyy-MM-dd").plusDays(remainingdays.asNumber)}} {{/}}
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.
Yes. this is my audit log
Can you share the screen shot of your rule to check if you have fixed the rule?
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.