Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Fieldtype "Last Public Comment" in calculation returns null to a "Number Field"

dahu February 15, 2024

Hello,

I got a Field of the type "Last Public Comment Date" with the Name "VorgangDatumLetzerÖffentlicherKommentar" where the timestamp from the last comment (not last public comment?!?!) is saved.

Then I want to calculate how long ago (in days) the last comment was set.

I use this:

{{now.diff(VorgangDatumLetzerÖffentlicherKommentar).days.abs}}

That worked fine with a field from type "Date Time Picker", where I saved the timestamp of the last comment with a rule when a comment was set. 

But we have to save rule executions now and because of that I want to use the "Last Public Comment" - Fieldtype to calculate the age of the last comment. 

The result of the calculation then is set as value of a field of type "Number Field" called "VorgangLetzterKommentarAlter". In the .json view the value of this field always is "null".

Has somebody an idea how to handle this?

Best Regards,

Daniel 

NumberField.pngfieldtype_lastPublicCommentDate.pngjson-field-value.pngjson-field.pngjson_number_field_value.pngjson_number_field.png

 

2 answers

1 accepted

0 votes
Answer accepted
dahu April 3, 2024

Hi @Kai Becker ,

the Problem was not solved.

I did what I needed with SLA.

Thank you for your help!

Best Regards,

Daniel

0 votes
Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2024

Hi @dahu 

on your second screenshot the custom field has the value 0.0.

How did it get this value? Does it work sometimes?

Does the Automation rule report errors in the audit log?

dahu February 16, 2024

Hello Kai,

thank you for your answer.

Because of value 0.0.  I can not tell from where or when the 0.0 value came from.

Always when I do it again, I got "null".

No, there is no error in the audit log of the rule.

Best Regards,

Daniel

Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2024

Could you try to add a log action to your rule and log the value of your smart value:

{{now.diff(VorgangDatumLetzerÖffentlicherKommentar).days.abs}}

 

dahu February 19, 2024

Hello @Kai Becker ,

thank you for your advice with the log action.

For 

{{now.diff(VorgangDatumLetzerÖffentlicherKommentar).days.abs}} 

I dont get a result in log action or if I set the result as value of a field the value is still "null"

But I had a look at the time-formats of {{now}} and {{VorgangDatumLetzerÖffentlicherKommentar}} and they are different:

{{now}}: 2024-02-20T07:31:33.7+0000
{{VorgangDatumLetzerÖffentlicherKommentar}}: 2024-02-15 14:31:27.648

Maybe that is the problem?

But I am not able to get the same time-format for them.

When I want to change the format like {{VorgangDatumLetzerÖffentlicherKommentar.jqlDateTime}} I get no result.

I can change the time-format of {{now}} like e.g. {{now.jqlDateTime}} but there is no time-format given at smart values date and time  in the first table that matches with the time-format of {{VorgangDatumLetzerÖffentlicherKommentar}}.

Do you think that this could be the problem and if yes do you have an idea how to bring them to the same format?

Thank you very much!

Best Regards,

Daniel

Kai Becker
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 20, 2024

Hi @dahu 

I would use .jiraDate for both, now and the field value. As you are calculating days between these two dates there is no need to mess around with time data.

Could you give this a try? 

Should probably look like this:

{{now.jiraDate.diff(VorgangDatumLetzerÖffentlicherKommentar.jiraDate).days.abs}} 
dahu February 20, 2024

Hi @Kai Becker ,

unfortunately it does not work.

VorgangDatumLetzerÖffentlicherKommentar is not able to be converted into an other format, even not .jiraDate.

With a log action it brings no result and

{{now.jiraDate.diff(VorgangDatumLetzerÖffentlicherKommentar.jiraDate).days.abs}} 

brings no result too, or as value for a field it is "null" 

dahu February 21, 2024

Hi @Kai Becker ,

I had contact with Atlassian-Support-Chat an they opened a ticket for that: PCS-256640

I wanted to share the ticket with you, but I think I do not have enough information about you to fill the share field.

So if you are interested, give me information for the share field.

Anyway, thank you very much for your time and help!

Best Regards,

Daniel

Kai Becker
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 2, 2024

Hi @dahu 

thanks for the update. I hope the Atlassian Support was able the help and the issue has been resolved.

If so, please make sure to accept an answer to mark the question as resolved.

If it has not been resolved, please feel free to get back with an update.

Suggest an answer

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

Atlassian Community Events