Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

SD_Event. Creating a Work order linked to a CI

Highlighted
Dave Furlani
Regular Collector

SD_Event. Creating a Work order linked to a CI

The situation. We have service calls linked to a CI for short term loans of the CI. When the CI is returned, we close the service call.

What I want to do is when the service call is closed I want a DB rule to create a work order linked to the same CI to have a post loan CI clean up done.

I have been playing with SD_Event to do this. I can create a work order no problems, but not linked to the CI.

Attached is the import mapping screen dump.

the command I am using is
sd_event -f "file location\DBrules.ini" -v CI=c2268 SCID=[ID] WOtemplate="Reimage PC or Laptop and return to storage" SDesc="Reimage of laptop or PC required"

As the Work order is being created I must have most things correct, but I really need help making the work order link to the CI, for my sanity sake. Please help. =o)

8 REPLIES
Jasper Verweij
Honored Contributor

Re: SD_Event. Creating a Work order linked to a CI

Dave,

You can link more than 1 CI to a workorder. In HPSD terms that means that there is other entity than "Workorder" responsible for handling these kind of relations.

In your case you need to execute 2 sd_events... 1 to create initial workorder with your current commandline (without CI) and the second one to link CI to this workorder with entity/item "Configuration item on Work Order"

The problem will be probably that you need to make sure that number 1 is executed and registered in the database successfully before number 2 is executed, otherwise it will fail....

Another possibility will be to code little application with web-api to accomplish this in one execution.

Jasper
Ruth Porter
Honored Contributor

Re: SD_Event. Creating a Work order linked to a CI

Hi Dave,

Another way would be to use the custom CI field on a work order for this and set up the Import mapping for this instead.

Hope this helps

Ruth
http://www.teamultra.net
Dave Furlani
Regular Collector

Re: SD_Event. Creating a Work order linked to a CI

Jasper, you don't happen to have a copy of a Web api script handy that I could edit to do this would you? =o)

Ruth, you idea sound very easy to achieve, but what do you mean by "set up the Import mapping for this instead"? Do you mean that I would have to set up the import mapping for the work order, and have sd_event set the CI field in the work order? If so, that makes sence. A nice simple solution.
Dave Furlani
Regular Collector

Re: SD_Event. Creating a Work order linked to a CI

Oops. Excuse the typos above.

Ruth, I tried your method but that doesn't seem link between the Work Order and the CI. I can't see the Work Order in the CI form, and the users require that.

I thought an addition to your idea might be to have a Work Order DB rule to relate the CI to the work order now that it has the data in the work order already, but it seems I'm back to where I started.

Surely there's an easy way to do this? I can't be the first person to want to link a Work Order to a CI using a DB rule.


When I tried using SD-Event to update a CI, it errored and said the CI already exists. I made sure the INI file was set to update, but as soon as I passed through an existing CI I got the error. I can create a CI no problems, so I must be close there too.

Any hints on the fields I need to by updating to link the CI to the Work order, the ini file settings, or other traps for young players, all greatly appreciated.
Dave Furlani
Regular Collector

Re: SD_Event. Creating a Work order linked to a CI

Jasper - Just to clarify, that's a suggestion to use Web API instead of the SD_Event, yeah?
Guenther Schere
Frequent Visitor

Re: SD_Event. Creating a Work order linked to a CI

Hi Dave,

I try to do the same. Link CI to workorder.
Do you already have a solution to this problem?

Thank you
Guenther
NELSON TOPETE
Acclaimed Contributor

Re: SD_Event. Creating a Work order linked to a CI

Hi,

Anyone have the solution for this issue, i try a lot of things with web-api without success.
Any Idea, example.

Regards,
Bruno.
NELSON TOPETE
Acclaimed Contributor

Re: SD_Event. Creating a Work order linked to a CI

Hi,

I find the solution for my question.

Here it is,

IWorkorderCIHome wkci_hm = bean.sd_session().getWorkorderCIHome();
IWorkorderCI wkci = wkci_hm.openNewWorkorderCI();
wkci.setConfigurationItem(cis[0]);
wkci.setWorkorder(wk);
wkci.save();

Best Regards.
//Add this to "OnDomLoad" event