Compartilhar via


Upload Attachment

Applies To: System Center 2012 - Orchestrator, System Center 2012 R2 Orchestrator, System Center 2012 SP1 - Orchestrator

The Upload Attachment activity is used to upload a file to an existing Service Manager object.

The following published data elements are specific to Upload Attachment. Additional published data is generated based on the Class that you select when you define the activity. For a list of the data elements published by each Class, see Service Manager Published Data.

Upload Attachment Published Data

Element Description

Object GUID

The unique identifier (GUID) of the single attachment to be updated

Number of Objects

The number of files successfully uploaded by Upload Attachment

Note

Be aware that the procedure to attach file attachments is different than the procedure to attach knowledge articles.

Configuring the Upload Attachment Activity Workflow for File Attachments

The Upload Attachment activity is dependent on other activities for the data that it requires.

For file attachments, the following activities will usually precede the Upload Attachment activity in a workflow:

  1. A parent record must exist. For example, you could use Create Change with Template or Get Object to get the Object Guid of a parent record where the attachment is to be uploaded.

  2. Use Get File Status to get information about the file to be uploaded. This activity retrieves the data needed to attach the file to the Service Manager object.

  3. Use Create Related Object to create a File Attachment related to the parent record. This activity creates the File Attachment object where the attachment is to be uploaded. There are several critical fields that must be correctly populated in order for the attachment to behave correctly in Service Manager

To configure the file attachment prerequisite activities for the Upload Attachment activity

  1. Create (or query for) a parent record where the attachment is to be associated. For example, from the Activities pane, drag a Create Change with Template activity to the active runbook.

    1. Double-click the Create Change with Template activity.

    2. Configure the Create Change with Template activity to update the Service Manager object to which you want to attach a file. For more information aboutusing this activity, see Configuring the Create Change with Template Activity.

  2. From the File Management section of the Activities pane, drag a Get File Status activity to the active runbook.

    1. Link the Create Change with Template activity to the Get File Status activity so that you can use data published by the Create Change with Template activity later in the workflow.

    2. Double-click the Get File Status activity. On the Details tab, click the ellipsis button (...), and then select the file(s) that you want to attach to the Service Manager object. Define the File age filters, and then click Finish.

  3. From the Activities pane, drag a Create Related Object activity to the active runbook.

    1. Link the Create Related Object activity to the Get File Status activity so that you can use data published by the Get File Status activity later in the workflow.

    2. Double-click the Create Related Object activity.

    3. On the Details tab, in the Properties section, click the ellipsis button (...), and then select the Connection to the same Service Manager computer that you used for the previous activities in the workflow.

    4. Click the Source Class ellipsis button (...), and then select Change Request.

    5. Click the Target Class ellipsis button (...), and then select File Attachment.

    6. Click the Relationship Type ellipsis button (...), and then select Has File Attachment.

    7. Right-click the Source Object Guid field, point to Subscribe, and then click Published data. Click Object Guid published data element from the Create Change with Template activity, and then click OK.

    8. Click Select Optional Fields. Select all of the optional fields, and then click OK.

    9. In the ID field, subscribe to the Object GUID of the parent incident/change record published data from the Create Change with Template activity.

    10. In the Size field, subscribe to the File Size (bytes) published data from the Get File activity.

    11. In the Display Name field, subscribe to the File Name published data from the Get File activity. Do not specify a file path.

    12. In the Description field, type a description of the attachment.

    13. In the Added Date field, subscribe to the current and time. One way to do this is to subscribe to the Object Start Time published data from the Get File Status activity.

    14. In the Extension field, enter a period ( . ) followed by the file name extension of the attachment to be added to the Service Manager object. For example, .txt. Alternatively, you can subscribe to the File Extension published data from the Get File Status activity. The File Extension published data element does not include the period so you will need to enter it manually prior to the published data link.

      The published data for each activity depends on the class that was selected when the object was created. For a list of the data elements published by each class, see Service Manager Published Data. For information about the Common Published Data items, see Published Data in the System Center Orchestrator 2012 Runbook Guide.

  4. From the Activities pane, drag an Upload Attachment activity to the active runbook.

    1. Double-click the Upload Attachment activity.

    2. Link the Upload Attachment activity to the Create Related Object activity.

    3. Right-click the Object Guid field, point to Subscribe, and then click Published data. Click the Object Guid published data element from the Create Related Object activity, and then click OK.

    4. In the Content field browse to find the file to upload as an attachment.

  5. For information about the settings on the General and Run Behavior tabs for each activity, see Common Configuration Instructions for all Activities.

  6. Click Finish.

Configuring the Upload Attachment Activity Workflow for Knowledge Articles

The Upload Attachment activity is dependent on other activities for the data that it requires. For knowledge articles, the following activities usually precede the Upload Attachment activity in a workflow:

  • A parent record must exist. For example, you could use Create Change with Template or Get Object to get an Object Guid of a parent record where the article is to be uploaded.

  • Use Get File Status to get information about the knowledge article to be uploaded. This activity retrieves the data needed to attach the knowledge article to the Service Manager object.

  • Use Create Object to create a knowledge article. This activity creates the knowledge article object where the article is to be uploaded.

To configure the knowledge article prerequisite activities for the Upload Attachment activity

  1. Create (or query for) a parent record where the attachment is to be associated. For example, from the Activities pane, drag a Create Change with Template activity to the active runbook.

    1. Double-click the Create Change with Template activity.

    2. Configure the Create Change with Template activity to update the Service Manager object to which you want to attach a file. For information about using this activity, see Configuring the Create Change with Template Activity.

  2. From the File Management section of the Activities pane, drag a Get File Status activity to the active runbook.

    1. Link the Create Change with Template activity to the Get File Status activity, so that you can use data published by the Create Change with Template activity later in the workflow.

    2. Double-click the Get File Status activity. On the Details tab, click the ellipsis button (...) and select the file or files that you want to attach to the Service Manager activity. Define the File age filters, and then click Finish.

  3. From the Activities pane, drag a Create Object activity to the active runbook.

    1. Link the Create Object activity to the Get File Status activity so that you can use data published by the Get File Status activity later in the workflow.

    2. Double-click the Create Object activity.

    3. On the Details tab, in the Properties section, click the ellipsis button (...), and then select the Connection to the same Service Manager computer that you used for the previous activities in the workflow.

    4. Click Select optional fields and add fields that apply to the knowledge article.

  4. From the Activities pane, drag a Create Relationship activity to the active policy.

    1. In the Source Class field, click the source class of the parent object created in step 1 (in this example click Change Request).

    2. In the Target Class field, click Knowledge Article.

    3. In the Relationship Type field, click Links to Knowledge Article.

    4. In the Source Object Guid field, click the object Guid from the source class of the parent object that you created in step 1 (in this example, click Change Request).

    5. In the Target Object Guid field, click the object Guid from the knowledge article created by the Create Object in step 10.

    6. In the Content field browse to find the knowledge article to upload as an attachment.

  5. For information about the settings on the General and Run Behavior tabs for each activity, see Common Configuration Instructions for all Activities.

To configure the Upload Attachment activity

  1. From the Activities pane, drag an Upload Attachment activity to the active policy.

  2. Link the Upload Attachment activity to the Create File Attachment activity so that you can use data published by the previous activities in the workflow.

  3. On the Details tab, in the Properties section, click the ellipsis button (...), and then select the Connection to the same Service Manager computer that you used for the previous activities in the workflow.

  4. Click the Class ellipsis button (...), and then select File Attachment or Knowledge Article to indicate the upload type.

  5. Right-click the Object Guid field, and then subscribe to the Target Object Guid published data element from the Create File Attachment activity.

  6. In the Fields section, right-click the Content field, and then subscribe to the Object Guid published data element from the Create File Attachment activity.

  7. For information about the settings on the General and Run Behavior tabs for each activity, see Common Configuration Instructions for all Activities.

  8. Click Finish.

Other Activities

The Integration Pack for System Center Service Manager contains the following additional activities: