a month ago - last edited a month ago
Hi all,
We are in the process of implementing SAP Service Cloud and Field Service Management. We are trying to figure out how to automatically approve efforts, mileage, etc. So in summary of what we are trying to achieve: engineer works on a job, records their time entries, closes the job, the time entries are passed through to the Time and Material Journal, the system automatically approves the time entries. It is this last part we are struggling with regarding the automatic approval.
I have created the following business rule based off of another article about automatic approval on this community forum, however it does not appear to be working.
Please could someone share how to set up a business rule that automatically approves time and material entries after the activity is closed?
Many thanks in advance!
Request clarification before answering.
Hello Josh, if you want to approve TE, you need to do it via Webhook (not FSM Webhook) with credentials of "decision maker". Not sure why, but it works for me only this way.
1st action you should get these creds viac API POST https://eu.fsm.cloud.sap/api/oauth2/v1/token.
header Authorization = Basic token generated for you Client Id which you normally use for API (e.g. via Postman)
username = format account/user (e.g. sap_p1/user01)
password = password123 for user in username
Body of action:
${[ [ "grant_type", "password" ], [ "username", sap_p1/user01 ], [ "password", password123 ], ].map(function(e) { return e[0] + "=" + encodeURIComponent(e[1]) } ).join("&")}
Then in 2nd action you again call Webhook for approval object where you are setting decisionStatus, decisionDate, decisionMaker, .... In header you are user access_token from 1st action via fuction parse:
Bearer ${JSON.parse(authResponse).access_token}
That should do it.
Filip
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
22 | |
15 | |
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.