Home General Discussion

Create a new Notification Activity with powershell?

Peter_NordqvistPeter_Nordqvist Customer Advanced IT Monkey ✭✭✭

Hi

Im trying to create a new Notification activity with powershell, and i have checked a manual created one that should send email to "Root Work Item" Affected User.. The recipient holds the InternalId.Guid of the user… im using this hashtable to create it, and it is created, but when the worflow runs i get a error..

$ArgHash =
@{"ID" = "RB{0}";
"Title" = $Title;
"Description" = $Description;
"Status" = $Status;
"SelectedNotificationTemplate" = "$($GetEmailTemplate.Id)";
"SelectedRecipients" = $receptiontxml;
"SequenceID" = $SequenceID;
}

The $reciptionxml looks like this:

$receptiontxml = @"
<AllRecipients>
<Recipient RecipientType="RelatedUser" WorkItem="Root Work Item" PrimaryRelationship="" PrimarySeedRole="???" Recipient="$us" SelectedSeedRole="Source" />
</AllRecipients>
"@

where $us is InternalId.Guid of the user..

The error i get is:

An error occured while obtaining an email address from recipient with saved attributes ' RecipientType="RelatedUser" WorkItem="Root Work Item" PrimaryRelationship="" PrimarySeedRole="???" Recipient="the guid" SelectedSeedRole="Source" '. Unable to parse recipient. The guid 'the guid' specified for the relationship class returned no relationship classes.

Someone done this or could point me how th set the recipient via powershell?

Thanks

Best Answers

Answers

Sign In or Register to comment.