Posts Tagged ‘Integration Project’

Hi All,

It has been a little while, i have been quite involved with an Integration Project. With this project there was a requirement to add comments to a Work Item. The information is passed on from “System A” to “System B” via XML. Using PowerShell, extracting the XML contents is not too difficult, if anyone would like to dive into that a little bit, please let me know with Comments.

I decided not to re-invent the wheel, so some searching was in order, and I found the following post, this post gave the basics. However every time I tried to add additional comments, the comments were over-written and NOT replaced. Not quite the desired effect. So after some more checking and research and tinkering within the Service Manager, I discovered the following about comments.

When adding a Comment, there is adding of a relationship class, already mentioned in this post, however it also uses a GUID.

2014-04-03_07-51-37

There is also another trick to adding comments within Orchestrator, this is discovered by trying to add a comment and then pulling all the available fields and looking at them. It is a small component which can be easily missed. The “Display Name” must also be the same GUID. So you might be asking how do we get the GUID?

Well, PowerShell can easily handle this for you.

$guid = [System.Guid]::NewGuid().ToString()

You simply use this a pre-cursor step and publish this data from “Run .Net Script”, so a sample would look like this.

2014-04-03_07-58-27

Get-Object Properties

I pass on the ID Value I want to modify from another Runbook

2014-04-03_07-58-58

Create Related Object Properties

I use an “Extended” class of comments needed for this project, principal remains the same.

2014-04-03_08-01-08

I hope this saves  you some time and add some value.

 

(E-Mail me)

 

Follow me,

 

Twitter (Personal & System Centre)

 Twitter (System Centre Focused)

Advertisements