Revert a custom date field to previous value using automation

Jessica Paes April 7, 2024

I am trying to set some controls around the custom field "Baseline Due Date', which should only be changed by the users in the 'PMO Group'.

Scenario 1 - if the field was empty, revert field back to empty

Scenario 2 - if the field had a date value, revert the field value back to the previous value

Here are some screenshots of my automation:

1.PNG2.PNG3.png

Problem:

When the rule runs, and there was a previous date set, the rule is clearing the date and setting it to "empty". How do I set it to the previous date that was in the ticket before the user tried to make changes to the date?

 

2 answers

1 vote
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.
April 8, 2024

Hi Jessica - Welcome to the Atlassian Community!

First, why don't you just not allow anyone to update the field except that Group? 

You can remove the field from the Edit screen. Then create a transition screen with only that field on it. 

Next, add a self looping transition to the status and place the new screen on that transition. Then place a Condition on the transition so that only someone in that group can execute the transition. 

What that in effect does is prevent anyone but that group from updating the field. 

Jessica Paes April 8, 2024

Hi John,

I have read some info about this approach. The team just doesn't want to have to add a new status to the workflow for this purpose.

Do I need to have a new status added to the workflow to achieve the following?

"add a self looping transition to the status and place the new screen on that transition. Then place a Condition on the transition so that only someone in that group can execute the transition"

Jessica Paes April 8, 2024

Hi John,

I think I have worked it out. I have added a self looping transition to the existing status 'In Progress' as a test. Is the following correct?

5.PNG6.PNG

What's the best practice for this in terms of what statuses I should add the self looping transition to? Select one for each workflow and let the PMO team know which one to use when changing the Baseline Due Date field?

Here are some of the workflows the team uses:

7.PNG8.PNG9.PNG

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.
April 9, 2024

Basically  it would need to be added to every status that for which you want them to be able to update the value of the field.

Like Jessica Paes likes this
0 votes
Sebastian Krzewiński
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 8, 2024

Hi @Jessica Paes 

 

IMO changelog smart value is something that you are looking for - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

 

Regards,

Seba

Jessica Paes April 8, 2024

Thanks, @Sebastian Krzewiński.

I tried using {{#changelog.BaselineDueDate}}{{fromString}}{{/}} but it is still not reverting back to the previous value.

4.PNG

 

Sebastian Krzewiński
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 10, 2024

I see that your CF name is "Baseline Due Date" and in smart value you use BaselineDueDate. You should use {{#changelog.Baseline Due Date}}{{fromString}}{{/}}

 

Regards,

Seba

Jessica Paes April 10, 2024

Hi @Sebastian Krzewiński 

I have updated the smart value to:

{{#changelog.Baseline Due Date}}{{fromString}}{{/}}

and also tried:

{{#changelog.customfield_12209.format("yyyy-MM-dd")}}{{fromString}}{{/}}

As the first smart value returned the following error:

(The Baseline Due Date must be of the format "yyyy-MM-dd" (customfield_12209))

10.PNG

However, when I test the automation, it clears the Baseline Due Date value instead of setting it to the previous value set by the users in the PMO or administrators group.
Would you have any idea what I am doing wrong and how I can set this up to revert the value to the previous value?
Regards,
Jess

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events