Can't compare an issue's custom date field to the same field in the trigger issue
Asked by Olie Ryan-George:

Automation I'm trying to setup: Upon removing the value from a custom datetime field, I want to remove the value the same custom field in all linked issues with the same value as the trigger issue before removing the value.

For some reason the datetimes of the trigger issue and the subject issue are in a different timezones. This means I can't do a direct comparison. This should be OK as I should be able to manipulate them to be in the same timezone. When I do this, the trigger issue's value seems to not be recognised as a date. This is whether I use fieldChange or changelog.

This is how I've setup my rule. I've deliberately put lots of logs so the behaviour can be shown.

![rule setup pt1.png](https://community.atlassian.com/t5/image/serverpage/image-id/275828i13FBF542F43F9C3B/image-size/large?v=v2&px=999 "rule setup pt1.png")![rule setup pt2.png](https://community.atlassian.com/t5/image/serverpage/image-id/275827i9485FD40074F67A5/image-size/large?v=v2&px=999 "rule setup pt2.png")![rule setup pt3.png](https://community.atlassian.com/t5/image/serverpage/image-id/275829iADED8297ECEEB0EF/image-size/large?v=v2&px=999 "rule setup pt3.png")

This is the result of the logs:

![rule logs hd.png](https://community.atlassian.com/t5/image/serverpage/image-id/275830iFF237FE4151BFC76/image-size/large?v=v2&px=999 "rule logs hd.png")

Does anyone have any suggestions on how to compare these two fields?

Edit: Removed images and added higher quality ones


Answers:
author: Stefan Salzl
body: Hi [@Olie Ryan-George](/t5/user/viewprofilepage/user-id/5295259) - welcome to the community,

Could you please provide the screenshots in higher quality? Unfortunately I can't read any line :-/

Best  
Stefan

comments: author: Olie Ryan-George
body: Hi [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993)

Thanks and appreciate your help in advance.

I've edited my original description with more zoomed in images.

Thanks,

Olie


author: Stefan Salzl
body: Hi [@Olie Ryan-George](/t5/user/viewprofilepage/user-id/5295259)

for me this looks like the fieldChange only delivers the string data type if your date.

Could you please try to add a ?.toDate" to the date you are fetching via fieldChange.

eg.:

{{fieldChange.from.toDate}}

Best  
Stefan


author: Olie Ryan-George
body: [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993) Hi,

This seems to be good progress as the log now matches with fieldChange using "toDate". However, even though it looks the same in the logs, it's not passing the advanced compare condition.

![rule logs pt2.png](https://community.atlassian.com/t5/image/serverpage/image-id/275895iC4F5201E656B79BC/image-size/large?v=v2&px=999 "rule logs pt2.png")![rule setup pt4.png](https://community.atlassian.com/t5/image/serverpage/image-id/275894i7DFC895DF020E777/image-size/large?v=v2&px=999 "rule setup pt4.png")

Any idea where to go from here?

Thanks,  
Olie


author: Stefan Salzl
body: Hi [@Olie Ryan-George](/t5/user/viewprofilepage/user-id/5295259)

I guess you would only want to have the "fieldChange" value in your second value isn?t it?

It looks like there is another value before that value (as there is a '=' before the {{fieldChange...}} ). Could it be that this is a copy paste from the "log action" ?

Best  
Stefan


author: Olie Ryan-George
body: Hi [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993)

Noooo! That was a silly mistake.

All working now. Really appreciate your help!

Thanks,

Olie


author: Stefan Salzl
body: Glad to know you got that working ;)

Please consider to hut the accept button next to the answer in order to mark this post as solved and make it easier for other user to find solutions to their questions ;

Best  
Stefan