0 votes

Hi team,

I have a business rule which is triggered, after an approval request was updated.

  • Is it possible to read the reason somehow (if entered by the approver)?
  • Is it possible to run these actions only against specific approval or commands which create approvals?
by (1.5k points)
0

Hello,

If you have a business rule configured for the ApprovalRequest object type (e.g. triggering After updating a ApprovalRequest), you can obtain the reason for denying or cancelling the request using the below code:

$reason = $Context.targetObject.DenialOrCancelingReason

The below code will obtain the reason for approving a request:

$reason = $Context.targetObject.ApprovingReason

Is it possible to run these actions only against specific approval or commands which create approvals?

Sorry for the confusion, but we are not sure what exactly you mean. Please, describe the desired behavior in all the possible details with live examples.

0

Thanks for your answer.

I tested your shared script, and it has the same value for approving and denying a request.

I also found this variable, holding the same information.

adm-DenialOrCancelingReason

Sorry for the confusion, but we are not sure what exactly you mean. Please, describe the desired behavior in all the possible details with live examples.

Right now my business rules looks like this image.png

This means, it would be triggered against all approvals, no?

I would like to narrow down it further, so this should be only executed if an approval was initiated by either one specific custom command or business rule.

1 Answer

0 votes
by (285k points)

Hello,

I tested your shared script, and it has the same value for approving and denying a request.

Thank you for pointing out the issue. We forwarded it to the corresponding department for consideration.

Right now my business rules looks like this

Thank you for the provided screenshot. The business rule should work just fine.

This means, it would be triggered against all approvals, no?

Yes, that is correct.

I would like to narrow down it further, so this should be only executed if an approval was initiated by either one specific custom command or business rule.

Unfortunately, there is no such possibility.

Related questions

0 votes
1 answer

In a custom command where an approval is added in Powershell code ($Context.SubmitForApproval) or as an action Send this operation for approval' how can you run specific ... is denied a mail is sent to requestors manager and requestors account is disabled.

asked Mar 28, 2023 by Pihl (20 points)
0 votes
1 answer

HI, I have scenario to perform a custom action based on the notification approval result. Before creating a user, i need to send out for an approval, if the request ... there a way we can achieve this. Any help/pointers or references would really appreciated.

asked Mar 4, 2016 by ramd123 (50 points)
0 votes
1 answer

I have set up an action that must be approved by me. I have not received any notifications when I execute the action. Should I receive an email to approve? If so, what am I missing in order to receive the approval request?

asked May 25, 2022 by Tfarmer (160 points)
0 votes
1 answer

Hello, We have a script that checks for expiring accounts (temp/contractor) and emails the users manager requesting that they respond to the email either approving an extension of the ... has expired, or at least send an email to the security group to do so.

asked Mar 11, 2013 by DFassett (710 points)
0 votes
1 answer

We have a New User action set up for our HR staff to use. There is a field in the custom form that states "Notes for IT Department". I want to display the data that is ... IT Helpdesk. I don't know what parameter this would be considered. How can I find out?

asked Feb 14, 2020 by slowllama (100 points)
3,511 questions
3,202 answers
8,152 comments
547,522 users