Workflow to send notification to a line manger after a new user creation

Hello Everyone,

I would like to send a notification email to a line manger after a new reportee joins under him. I’m using the attached json file but notification email is not triggering. Could any one please help.

Kind regards
Mane

Looking at the output of the Get Identity action, your JSONpath does not appear to be valid. The manager of an identity is stored in the managerRef property. In your recipient field, try $.getIdentity.attributes.managerRef.id instead.

Thank you @colin_mckibben for your quick reply. I’ve updated manager reference Id as per your suggestion. But still notification email is not triggering. Also, after uploading json and saving in builder I’m forced to update : replyTo filed. Could you kindly see the attached images and suggest?

Thank you & Kind regards
Mane


Your reply to says “Enter Value”. That means you have to enter text and/or use variable insertion. If you just want to supply the manager ID, then make sure to select “Choose Variable” from the dropdown.

Thanks a lot @colin_mckibben for your quick response. However, it appears that there is no relevant attribute for selecting the manager.


Kindly see the attached screenshot. Could you please recommend one so that the manager receives an email notification?

Thank you & kind regards
Mane

You don’t have to use the variable picker when selecting “Choose Variable”. You can paste your jsonpath in the text box instead.

Choose variable means you are specifying the jsonpath to a single variable. This can be done with manual jsonpath, or you can use the variable picker to fill in the jsonpath for you.

Thank you very much @colin_mckibben


5_templating context
for your reply. But please accept my apologies if I’m not lined up correctly or if I’m missing something. I’ve used “$.getIdentity.attributes.managerRef.id” in both recipient email address and replyTo address. But mail is not triggering to line manager. If I use a specifc value in recipient email address, then mail is triggering. I’ve checked with my mail Id, but could you please advise a way to send mail to manger?

I can see that your workflow doesn’t use the “Get Identity” action. Your email isn’t triggering because you are referencing a variable that doesn’t exist. You will need to use the “Get Identity” action after the “Provisioning Completed” trigger to get the details of the identity that is the target of the provisioning event. Once you do that, your email should send.

Hi @colin_mckibben,

Good day!

Many thanks for your reply. I’ve tried the way you suggested with some permutations but didn’t get the expected result. Could you please suggest. I’ve also used $.getIdentity.attributes.managerRef.email in templating context and recipient mail adddrss

Thank you and Kind regards
Mane




What was your expected result and what was the actual result?

Thank you @colin_mckibben , expected result is that when a user joins IdentityNow, his line manager should receive a notification email. I’ve also tried with the trigger “Identity Created.” Please see the attached screenshot. But the manager is not receiving notification emails. For example, if Flintoff is the line manager for user yuvraj, Flintoff should receive an email stating that your reportee yuvraj has joined identityNow after creating yuvraj’s details with Flintoff as the manager in IDN.

So the manager isn’t receiving the email at all? I think the problem is in screenshot #2. The recipient email address should be an ID, not an address. Try $.getIdentity.attributes.managerRef.id in Recipient Email Addresses text box.

Hi @colin_mckibben ,

I’m trying to send a notification to the manager accordingly, as you suggested(as per images 3 and 4), but mail is not triggering. I’m also trying other combinations, but it’s not working. Could you please suggest one?


{
	"name": "Line Manager1",
	"description": "A nine-step workflow to trigger when a detected outlier score is at or above 0.9. When the score is this high, all accounts for the identity are disabled and an email notification is sent to their manager to review access and investigate the exceptions.",
	"modified": "2023-02-17T12:54:28.582637912Z",
	"modifiedBy": {
		"type": "IDENTITY",
		"id": "d66d04c5856c4e01889d81dd8436fcd6",
		"name": "Manikanta Sai"
	},
	"definition": {
		"start": "Get Identity",
		"steps": {
			"Get Identity": {
				"actionId": "sp:get-identity",
				"attributes": {
					"id.$": "$.trigger.attributes.managerEmail"
				},
				"nextStep": "Send Email",
				"type": "action",
				"versionNumber": 2
			},
			"Send Email": {
				"actionId": "sp:send-email",
				"attributes": {
					"body": "Dear  $manager, <br>\n\nA new user  $firstname has been created in IDN. <br>\n\nThank you <br>\n<br>\nMane",
					"context": {
						"firstname.$": "$.getIdentity.attributes.firstname",
						"lastname.$": "$.getIdentity.attributes.lastname",
						"manager.$": "$.trigger.attributes.manager.name"
					},
					"from": "[email protected]",
					"recipientEmailList.$": "$.trigger.attributes.isManager",
					"replyTo.$": "$.trigger.attributes.managerEmail",
					"subject": "New user creation"
				},
				"description": "Sends notification to line manager",
				"nextStep": "success",
				"type": "action",
				"versionNumber": 2
			},
			"success": {
				"type": "success"
			}
		}
	},
	"creator": {
		"type": "IDENTITY",
		"id": "d66d04c5856c4e01889d81dd8436fcd6",
		"name": "Manikanta Sai"
	},
	"trigger": {
		"type": "EVENT",
		"attributes": {
			"id": "idn:identity-created"
		}
	}
}

Thank you & kindregards
Mane




It might help if you start from a template. Create a new workflow and select “From Template”. Scroll down until you find the Send an Email when an Access Request is Decided.

This template will show you how to get an identity’s manager and send an email to the manager.

Thank you @colin_mckibben , after creating a new workflow it worked :slight_smile: .

Thanks & Regards
Mane