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

Changed From, Changed To - for a Custom Single Select Field

Jugal Doshi May 20, 2024

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}}

2 answers

1 accepted

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2024

Hi Jugal - Welcome to the Atlassian Community!

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

Jugal Doshi May 20, 2024

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. 

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

Thanks for the additional information. Try just using this:

{{fieldChange.fromString}}

{{fieldChange.toString}}

Like Rick Westbrock likes this
Jugal Doshi May 20, 2024

Sweet. 

{{fieldChange}} property worked. 

 

Thank you, John! 

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 20, 2024

Great! Glad that worked for you. 

0 votes
Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2024

Hello @Jugal Doshi 

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

Jugal Doshi May 20, 2024

Hello Kalyan, 

Thank you for your response. 

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

1) My Rule

2) Output ValueRule.pngOutput.png

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

 

 

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2024

Hello @Jugal Doshi 

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!

Kalyan Sattaluri
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2024

Of course other option is to use {{fieldChange.toString}}

Jugal Doshi May 20, 2024

Thanks, Kalyan. 

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

Thank you for all your help :) 

Warm regards, 

Jugal

Like Kalyan Sattaluri likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events