How do I change Approver after it has been set in the workflow?

levi.rooker January 11, 2023

Currently we have approval steps that are setting the approval by a Custom Field. 

However, sometimes that approver needs changed (they are on vacation, they were fired, they moved to a new position etc.). When we change the custom field that the approver is based upon we want the approval field to update accordingly. 

This is not the behavoir. The custom field updates through an edit, but the approval field does not. We tried to add a transition called "Replace Approver" that attempts to write the new value to the Approval field, using the same logic as the Approval in the workflow.

This transition has two post-conditions:
"The value(s) of the Jira User attribute of the objects selected in the Approver field are assigned to the Approvals field"
as well as
"The value(s) of the Jira User attribute of the objects selected in the Approver field are assigned to the Approvers field"

When the transition occurs, nothing happens to the Approval field but the Approver field is updated with the Jira User name of the person selected in the custom field that the approvers is based upon. 

Completely stuck on this one. 


2 answers

1 accepted

0 votes
Answer accepted
Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2023

Hi @levi.rooker 

Is this Server or Data Center?

Can also you clarify the logic...

  • You have a Custom Field, which has Approvers in it
  • This field updates the Approvers field
  • This is done using Post Functions when a ticket which needs approval is created

...is that correct?

---

Just to confirm - is there a reason you can't edit the Approvers field directly? This would update the users immediately within the Service ticket, albeit without a notification - but this could be sent using Automation (native to Data Center v.9 onwards), etc.

If there's logic as to why the Custom Field is needed, that could be beneficial here :)

---

Are you using this logic to set the Approvers from a custom field? -  https://confluence.atlassian.com/adminjiraserver/configuring-jira-service-management-approvals-938847527.html

If yes, this is a Status property, not a Transition property. You might need to:

  • Have a check which confirms if Approvers is empty post-transition
  • If yes, loop to a pending Status (eg. Approvers Required)
  • Add the Approvers, then transition it back to the Approval Status

It might be possible to Automate some of this, depending if this is Server/DC, and what Apps you have.

Ste

levi.rooker January 12, 2023

Thanks Stephen,

Your suggestion got me thinking about approaching this from a different angle. I was able to resolve by creating a transition to re-assign approver (even added it the portal in case the user needed to do it themselves).

If Re-assign Approver transition is chosen, then transition clears approvers. A screen pops up, user assigns approver, Jira gets the new approval from custom field transitions (temporarily) to a status of "Approver Re-assigned" then transitions back to the Approval, updating the approval by the custom field.  

Apparently, the issue was not just adding and clearing the approver but was also to have a status change to clear the status of "Approval". Just building a simple loop didn't do the trick. 

0 votes
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2023

@levi.rooker to add on to what @Stephen Wright _Elabor8_ shared you can also simply edit the issue and add the approvers.  The only issue with doing this is that they will not be notified via email since they were not the approver on the transition.  You can simply add a comment asking them to approve in the portal.  Just one additional option.

Stephen Wright _Elabor8_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2023

Absolutely!

You could also use Automation, or a similar App, to send a custom notification to these users.

I've modified my answer to include questions in relation to this, so it's well-rounded - thanks Brant!

Ste

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
4.20.1
TAGS
AUG Leaders

Atlassian Community Events