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

Copying data from a SC field to a Change or Work Order.

SOLVED
Go to solution
Highlighted
Michael Daly_2
Collector

Copying data from a SC field to a Change or Work Order.

I am using Service Desk 4.5(SP-20) on a Windows 2000 system with a SQL database.

I have created an 'Entity custom field' called 'Customer' that is an Organisation lookup reference field that I have put on Service Call, Changes and Work Order forms. It is the same name and type of field to keep the commonality for the user when filling in either of these three forms.

I have tried to use the "Copy Fields" feature in the Administrator Console by ticking on the 'Customer' field in Service Calls, Changes and Work Orders. I assumed this would allow the 'Customer' field contents to be copied from the Service Call to a Change if I used the menu option from a Service Call called 'Actions' then chose the 'Create Change - copy values from current item'. It doesn't work. Does anybody know why?

I then tried to use a UI rule to use a Data Update to copy the value from the Service Call.Customer field to the related Change.Customer field. The trouble is that from a Change UI rule I can't see any of the fields from a Service Call. Why not?

Does anyone know how to copy field contents from a ServiceCall - Organisation field (in my case called Customer) to a Change - Organisation field (also called Customer)?

Many thanks.

Michael Daly
20 Feb 2007
16 REPLIES
Mark O'Loughlin
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

Hi Michael,

have you had a look to see if it will work with a smart action using sd_dataform and adding the custom field as a parameter?
Alexey Dukov
Frequent Visitor
Solution

Re: Copying data from a SC field to a Change or Work Order.

Hi Michael !
Also you can use trigger on SQL Database withc copy your information when you save a related SC and Changes (workorders).

For example
CREATE trigger copy_doc on itsm_service_relations

for insert as

declare @sc bigint
declare @inc bigint
declare @doc nvarchar(255)


if (
(select sre_ser_oid from inserted) is not NULL
and (select sre_inc_oid from inserted) is not NULL

)


begin

set @sc= (select sre_ser_oid from inserted)
set @inc= (select sre_inc_oid from inserted)

if (select icf_incshorttext7
from itsm_inc_custom_fields
where icf_inc_oid=@inc) is null
begin

set @doc=(select scf_sershorttext1
from itsm_ser_custom_fields where scf_ser_oid=@sc)

update itsm_inc_custom_fields
set icf_incshorttext7=@doc
where icf_inc_oid=@inc --icf_inc_oid svaz

end



end

Best Regards,
Alexey
Robert S. Falko
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

Michael,

Regarding copy fields, this will fail if the copy field is not on the both the source and target forms. Could this be your problem?

Regarding updating with UI rules, there is a known problem with UI rules and custom fields that are dependent on categories (ITSM008879). Could this be your problem? It is supposed to be fixed in SP21.

Regarding sd_dataform, there is a known problem in using this technique (admitted via support, although HP has not put it on the web site) that was introduced in SP18 (I think), which can cause the creation of the relation to fail. This is supposed to be fixed in SP22 (the phantom of our little opera here). There are also problems with the length of the string you can use to copy fields, which may be an issue for you. The workaround (if it is acceptable to you) is to disable the jar file for the service pack on the client.

Regarding using a direct update of the database to perform the task, use this at your own risk, as it supposedly invalidates the support contract.

Good luck,
Josh
Michael Daly_2
Collector

Re: Copying data from a SC field to a Change or Work Order.

Thanks everybody for your replies.

I'll have to invetigate how to use sd-dataforms. I have looked at Smart Actions but I couldn't find a way to make it work.

Although it appears to be a brilliant piece of code I am not confident of how to implement direct data manipulation of the data tables.

Josiah, I DO have the 'exact' same name and type of field on each form, and the length of the data to be transferred is quite short (like 20 or 30 characters). I saw a lot of complaints from SP-21 and I tried like many people to download SP-22 after receiving notification but I haven't seen any feedback of successful downloads or implementation. I am keen to try SP-22 when it becomes available as I was hoping for an easier solution, but it doesn't appear if there is a simple solution like the simple UI rule I use to copy this data from my Change form to my Work Order from when I click on the Actions -> 'Create Workorder - Copy values from current item'. This action copies the Change.Customer field to the WorkOrder.Customer field.

It's not the end of the world if the users have to manually fill in extra fields but I was trying to automate this process and reduce errors on making sure the data was consistent across the Service Call (which is where the initial call for service is entered), then we create a Change Request for this same work, and finally where the work is actually done in the Work Order. All three items are related and are for the same job and same customer.

I'll have to take a closer look at SP-22 when it becomes available to see if it will work for this solution.

Many thanks again...

I'm still happy to hear more solutions...
George M. Meneg
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

Hello Michael,

You can't use UI rules to copy service call customer to change customer field, but you can use db rule for that.

Or better use a service call smart action with sd_dataform. The action command line parameter should be like this:

"change" +"relations.service call.id=[ID]" +"relations.relation type.text=" +"customer=[Caller;Searchcode]" -ForceNew

Have a look at http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=808712, you can do many things using sd_dataform.
menes fhtagn
Michael Daly_2
Collector

Re: Copying data from a SC field to a Change or Work Order.

Hi George

Thanks for your contribution. I can't see how a Db rule would work because it has the same problems as a UI rule. You can't see the 'Service Call' item in the field list when building either a DB or UI rule.

I can't find any [F1] help about SD_Dataform from within Service Desk (I wish HP could build a decent Help file!!!) and the link you contained keeps getting a 'System Unavailable' error message. I still can't get this option to work but I'll keep trying.

The other problem I can see with using the Smart Action with SD_Dataform is that when I use an Action to Create a Change option there is NO ID code or number for the new Change at that point in time.

Can I just clarify that the new Smart Action is in the Service Call group as opposed to the Change group. Is this correct?

Thanks again.

Michael
Michael Daly_2
Collector

Re: Copying data from a SC field to a Change or Work Order.

Hi George

I've had a partly successful day trying to learn how this Dataform works. I have a new Change being created, and my Change.Customer field is being populated from the data from my ServiceCall.Customer field. I also have the relationship (between the Service Call and the Change) form fields being correctly filled in.

Two questions:
1. The new Change form being created is the wrong Change form. It is an old one we use for testing and not my default Change form. Can I add in my SD_Dataform parameters which Change form to use?

2. After giving all the data to the Relationship form can you send an [Enter] key command (in my SD_Dataform parameters) to be the same as clicking the [OK] button to accept that data and automatically close that relationship form?

Thanks again.

Michael Daly
21 Feb 2007
Peter Dent
Frequent Visitor

Re: Copying data from a SC field to a Change or Work Order.

Michael,

You are correct in saying that you cannot use a DB rule to copy the data because you cannot see the field in those listed by the system.

However, I have a DB rule which does exactly what you are trying to do. Mine copies data from the related Work Orders to the Service Call form. This happens each time a user enters data into the Information field of the WO and saves the form. In this way the SC form becomes the central repository for all information from all associated WO's.

There is a little trick to doing this.

In the box where you normally see the name of the field you have chosen, simply type the name of the form you want to update, followed by a semi colon (;), followed by the field name you wish to update. (See my attached Word doc for an example. The example shows a Work Order DB rule updating the Service Call;Information field).

Obviously the correct spelling of the field name is critical but, if you get it right the VALUE field becomes active for you to enter or choose the value you want to update with.

I use this method a few times to relate back to the Service Call from the WO etc.

This works on SD 4.5 SP17, I can't say for definite it will work with your installation.

Regards
George M. Meneg
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

Hello Michael,

This is the link

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=808712

there was a , at the previous, thus it wouldn't work. You can read about sd_dataform in administrator's guide.

Now about ui rules: UI rules cannot update related entities (when relations are 1-many) but db rules can. All you have to do at the update data is to check "Select a related item?" and select the item from the drop down list.
menes fhtagn
Robert S. Falko
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

SP 22 is indeed available now and does indeed claim to fix the sd_dataform bug.

You would use UI rules to execute sd_dataform.

-Josh
Peter Dent
Frequent Visitor

Re: Copying data from a SC field to a Change or Work Order.

George,

You are correct in that you can select Related Items when creating a DB rule but, this does not give access to the Service Call form fields from a Work Order. It only allows access to Predecessor, Sucessor, Config Items etc.

Only the method I dscribed will allow that :-)
Peter Dent
Frequent Visitor

Re: Copying data from a SC field to a Change or Work Order.

Sorry, I didn't mean to sound so smug there.

I just think its a neat trick and is very usefull.

I didn't find it by the way, it was probably George who told me how to do that in the first place.

He's helped me many times already . . .

Regards
George M. Meneg
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

Hello,

Peter, no worries! I'm also aware that you can use the typing for work orders but this doesn't work for relations between other entities. The relation between a workorder and service call/problem/change/incident is of different nature.

To a workorder a service call is like code. Let me explain that:

The relations between problems, incidents, changes and service calls are hold on the table itsm_service_relations. On the other hand the relation between, let's say a workorder and a service call is hold to the table of workorder itself.

There is a column on the workorders table named wor_ser_oid. It holds the OID of the service call that workorder belongs to. Like this, there are the columns wor_cha_oid, wor_inc_oid and wor_pro_oid. As you see the "relation" is saved directly to the table of workorders. The same is also correct for codes, for example the work order priority is stored in column wor_pri_oid. In that context, a service call is to a work order like a "code". Each workorder can hold at most one service call.

Now, the relation between change and service call is more complex. It is stored in a different table (the itsm_service_relations) because the relation is n-m.

Any service call can be linked from/to any number of changes. And this service relation, needs three objects to be defined
1. The from object
2. The to object
3. the relation type

That's way while you can use the same type trick on a ui rule, it won't work. You need db rules to do that, that will update ANY related item to a service call since there can be any number of related items to a service call.

The original question is to update a change field based on a value on a related service call. This can be done only with DB rule.
menes fhtagn
George M. Meneg
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

One thing is sure for service desk: It may have some pretty irritating long stand bugs but it is a extremely well thought product. I have yet to see any other product designed this way. Hell, you can document fields, items and their relations with one query!

I bet that the guys on our billing system would sell their soul for this functionality!

And the bonus is that service desk has undocumented features that rock! HP actually made the product better than they thought. It seems a pity that they abandoned it for Service Center. It is true that I have heard many good things about this product but I will believe it only when I see it and not a moment before that.
menes fhtagn
Michael Daly_2
Collector

Re: Copying data from a SC field to a Change or Work Order.

Thanks Peter, George and Josiah.

I've been able to get a Smart Action from my Service Call to work with the following code in the Parameters field on the Smart Action form:

"Change Request (CR) Form" +"relations.service call.id=[ID]" +"relations.relation type.text=Solved by" +"Config Item=[Config Item]" +"Customer.name=[Customer;Name]" +"Billing Ref:=[Billing Ref:]" +"Customer Ref:=[Customer Ref:]" +"Brief Description=[Brief Description]" +"Requestor.name=[Caller;Name / Number]" +"Planned Start=[Planned Start]" +"Planned Finish=[Planned Finish]" -ForceNew

Our Change Management 'process' dictates that we create a Service Call when we get a new email from the customer. This new work is analysed by a Technical Team Leader and a resource from his team is selected to do the work (they become the Change owner). This is entered into the Service Call form and sent back to another person. We then use as much information off this Service Call form to create a new Change Request form and a number of Work Orders. The related Service Call form is then closed. Thus we don't want to work backwards to update the Service Call form with info off the Work Order form because the Service Call form is closed. The times from the related Service Call, Change and Work Order forms are then summarised to extract labour times which we use to invoice our external customers.

It's not the most ideal way of keeping the data consistent across these forms but it's a lot better than the options I had before all your help. I'm very happy there is a way to do what seemed impossible. As George said HP have created some very powerfull tools once you know where to find them and how to use them.

Thanks very much one and all.

Regards,

Michael Daly
22 Feb 2007
Robert S. Falko
Honored Contributor

Re: Copying data from a SC field to a Change or Work Order.

Michael

We have done almost exactly the same as you; the difference being that the Service Call (which is the only ticket the change requester sees), is not closed until the change ticket is closed. Service Levels for change requesters are managed using the Service Call.

-Josh
//Add this to "OnDomLoad" event