onsdag den 10. april 2013

Attaching a file to a Work Item using Orchestrator

As I found Microsoft's documentation for Upload Attachment somewhat lacking, so I will share my experience. This tutorial will help you attach a file to a given Work Item such as a Service Request or an Incident.
The final product will look something like this:
Add a parameter to Initialize Data that will contain the given Work Items ID, in this case a Service Request.
Get SR (Get Object) is as expected. Select whatever Work Item class you wish to attach a file to.
Get File Status from the File Management integration pack is also very straightforward. Select the file one wish to attach. If this is a variable value, one could add the filename (possibly one a network shared drive) as a parameter to Initialize Data.
As opposed to Microsoft's step 3.9 in the linked documentation, I would much rather give the attachment a unique identifier, and for this purpose I shall use Powershell. Script is as follows:
For your copy-paste leisure: $guid = [guid]::NewGuid(), and in the Published Data tab do as follows:
which will make the newly created guid available on the databus (and used in the following activity).
Next we will use the Create Related Object activity which looks like:
And the rest of the fields:
At this point the given Work Item would have an attachment. The final step is to put content into the attachment using Upload Attachment:
Note that the Object Guid is Target Object Guid from the previous activity (easy detail to miss in the documentation).

Ingen kommentarer:

Send en kommentar

Søg i denne blog