Service Desk Practitioners Forum
cancel

Extract from text field and set to default predefined field

Highlighted
amykoh
Outstanding Contributor.

Extract from text field and set to default predefined field

Hi all,

I'm trying to extract a portion of words from a field and set it to another field.

The extracting part, I think Ive managed that, I used the 'Take Part of' function to estimate the size of my extraction.

Anyhoo, after extracting, I want to set a field to the output of the extraction.

My scenario:
Email comes in to SD and creates a new ticket. Details will be in Description and Information.

I need to extract the CI name in Information field and set it to Configuration Item in the ticket so I can relate this to SLA/Service.

Ive tried directly extracting from Information and setting it to Configuration Item, but didnt work.

I also tried extracting it to another custom field, then setting it to Configuration Item, didnt work as well.

I realize I get this error in logserver file everytime I try to set to the SD's default CI field. But it works fine with normal text field.

Fri, 05/08/2005 14:40:27 Rule: SMS Hp to CI Search code Action: SMS Hp to CI search code (Update Data) Entity: Servicecall
Fri, 05/08/2005 14:40:27 RuleManager Error:Updatejava.lang.NullPointerException
at com.hp.ifc.ev.rules.AppExecuteDataUpdate.update(Unknown Source)
at com.hp.ifc.ev.rules.AppExecuteDataUpdate.execute(Unknown Source)
at com.hp.ifc.ev.dbrules.AppDBRuleManager.runActions(Unknown Source)
at com.hp.ifc.ev.dbrules.AppDBRuleManager.handleEvent(Unknown Source)
at com.hp.ifc.ev.dbrules.AppDBRuleManager.handleEvent(Unknown Source)
at com.hp.ifc.ev.AppEventQueueReader.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Any ideas how I can configure this scenarion?..

Many thanks..

Amy

7 REPLIES
George M. Meneg
Acclaimed Contributor.

Re: Extract from text field and set to default predefined field

Hello Amy,

Could you please post the db rule ?
menes fhtagn
amykoh
Outstanding Contributor.

Re: Extract from text field and set to default predefined field

Hi,
These are the db rules.

The extracting db rule:
When SC is created or modified
AND NOT (Information * is empty)
CIName set to (Take part of [Information] From position 1 Number of Chars 20)


The setting/mapping db rule:
When SC is created or modified
AND NOT (CIName * is empty)
Configuration Item;Source code set to CIName

Thanks.

Amy
George M. Meneg
Acclaimed Contributor.

Re: Extract from text field and set to default predefined field

Hello Amy,

<<
The setting/mapping db rule:
When SC is created or modified
AND NOT (CIName * is empty)
Configuration Item;Source code set to CIName
>>
Here lies the error. In order for this to work it must be changed to:

When SC is created or modified
AND NOT (CIName * is empty)
Configuration Item set to CIName

This thing would not be possible if there weren't and interesting bug of service desk found and exploited by Oguz Kutlu Asik. Read on
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=787798
to found out how to make the appropriate changes.
menes fhtagn
George M. Meneg
Acclaimed Contributor.

Re: Extract from text field and set to default predefined field

Note however that this "bug" may be patched in the future, thus preventing the rule to be "altered" or even executed
menes fhtagn
amykoh
Outstanding Contributor.

Re: Extract from text field and set to default predefined field

Hi George,

I tried Oguz's method and it did as what Oguz said.

However, when I tried to run the rule on Configuration Item set to (Convert to upper case for [CIName])

It didnt work. No changes.

So, I changed Configuration Item field to Solution field(a text field) to test and it changed as expected.

Could it be that Configuration Item field cannot be mapped this way?..

Amy
George M. Meneg
Acclaimed Contributor.

Re: Extract from text field and set to default predefined field

Hello Amy,

for this to work you must set

CI = CI;Searchcode using Oguz trick.
menes fhtagn
amykoh
Outstanding Contributor.

Re: Extract from text field and set to default predefined field

Hi George,

Unfortunately, your suggestion didnt work.

Someone else replied that because the Configuration Item field is a lookup to another table the DB rule may not be able to handle such a query.

A suggestion made was to use the sd_event. However, the 3rd party application is unable to run the sd event command. That's why the only option is via email trigger.

Amy