Changed From, Changed To - for a Custom Single Select Field
Asked by Jugal Doshi:

Hello,

To provide some context, in our cloud instance, we have created a custom single select field called 'Sub-Portfolio Manager'. I am trying to automate a notification to an appropriate team whenever the custom field (Sub-Portfolio Manager) is changed. However, I'm not able to successfully achieve Changed From and Changed To values.

I'm using the following smart values in the Content section of my Automation Rule body:

**Date of Change** : {{updated}}  
**Initiative Name** : {{issue.summary}}  
**Sub-Portfolio Manager Changed From** : {{#changelog.customfield_10287}} {{fromString.asText}} {{/}}  
**Sub-Portfolio Manager Changed To** : {{#changelog.customfield_10287}} {{toString.asText}} {{/}}  
**Initiative ID:** {{issue.customfield_10304}}  
**Current year $**: {{issue.customfield_10123}}


Answers:
author: John Funk
body: Hi Jugal - Welcome to the Atlassian Community!

What is working and what is not working? What is the result when you run it?

comments: author: Jugal Doshi
body: Hello John,

Thank you for your response.

**What am I trying to achieve?**

* I am trying to automate a notification to an appropriate team whenever the custom field (Sub-Portfolio Manager) is changed.
* Current Rule:
  * Date of Change: {{updated}}  
    Initiative Name: {{issue.summary}}  
    ++**Sub-Portfolio Manager Changed From**++ : {{#changelog.customfield_10287}} {{fromString.asText}} {{/}}  
    ++**Sub-Portfolio Manager Changed To**++ : {{#changelog.customfield_10287}} {{toString.asText}} {{/}}  
    Initiative ID: {{issue.customfield_10304}}  
    Current year $: {{issue.customfield_10123}}

What is not working?

* Based on the rule above, my automation output does not yield any values for 'Sub-Portfolio Manager Changed From' and 'Sub-Portfolio Manager Changed To'
* Output Result:
  * Date of Change: 2024-05-20T16:50:15.8+0000  
    Initiative Name: Pega Upgrade-Prime - V8.8.4 - Jugal  
    **Sub-Portfolio Manager Changed From:**   
    **Sub-Portfolio Manager Changed To:**   
    Initiative ID: 11154  
    Current year $:

Your help is appreciated.


author: John Funk
body: Thanks for the additional information. Try just using this:

{{fieldChange.fromString}}

{{fieldChange.toString}}


author: Jugal Doshi
body: Sweet.

{{fieldChange}} property worked.

Thank you, John!


author: John Funk
body: Great! Glad that worked for you.


author: Kalyan Sattaluri
body: Hello [@Jugal Doshi](/t5/user/viewprofilepage/user-id/5406986)

Is your trigger "Field Value Change"?

Cause if its not, then you wont get any values.

But if it is "Field Value Change".. all below should work:

* {{fieldChange.toString}}
* {{changelog.Your Field.toString}}
* {{#changelog.Your Field}}{{toString}}{{/}}

Please log these values and share screenshot if your rule / audit log

comments: author: Jugal Doshi
body: Hello Kalyan,

Thank you for your response.

Yes, the trigger is Field Value Change. I've attached two screenshots

1) My Rule

2) Output Value![Rule.png](https://community.atlassian.com/t5/image/serverpage/image-id/324845i711A43C95F21A2A8/image-size/large?v=v2&px=999 "Rule.png")![Output.png](https://community.atlassian.com/t5/image/serverpage/image-id/324846i690CA67DFEA270D7/image-size/large?v=v2&px=999 "Output.png")

I'm still not seeing values being populated for 'Sub-Portfolio Manager Changed From' and 'Sub-Portfolio Manager Changed To'.


author: Kalyan Sattaluri
body: Hello [@Jugal Doshi](/t5/user/viewprofilepage/user-id/5406986)

When using {{ChangeLog}} smart values, you have to reference the field by the screen name. Referencing the field by Customfield does not work.

So if you change your syntax to {{changelog.**Your Field**.toString}} it will work.

NOTE: Field name has to be exactly as is on screen. Dont replace spaces etc.

You can see this when you go to the end point to look at how changelog is captured,

https://**yourdomain** .net/rest/api/2/issue/**ABC-61**?expand=changelog

fields are referenced by screen names.

Hope it helps. Thanks!


author: Kalyan Sattaluri
body: Of course other option is to use {{fieldChange.toString}}


author: Jugal Doshi
body: Thanks, Kalyan.

I tried the {{fieldChange.fromString}} and {{fieldChange.toString}} properties and it worked.

Thank you for all your help :)

Warm regards,

Jugal