Service Desk Practitioners Forum
cancel

Using contains (AND) & (OR) Operator

SOLVED
Go to solution
Highlighted
amykoh
Outstanding Contributor.

Using contains (AND) & (OR) Operator

Hi all,

I'm having some difficulties with these operators.

Here's my scenario:

I have OVOW creating tickets in SD Incident using sd_event command parameters.

One of the parameter is the nodename of the server which triggered the msg. The nodename is intended to map with the CI in SD.

So far I have been unable to just extract the hostname of the server, it keeps sending the FQDN. I cant seem to find the variable.

So instead, Ive created another field(CI Trunc) where I can trim off parts of the FQDN and map it to CI. BUT I would like to add in another condition where if only

CI Trunc field contains the words "domain.com" then only trigger the truncation. As there are some node names which are without the FQDN.

After new item has been opened
OR After existing item has been opened
where NOT (Temp CI is empty)
AND Solution contains domain
Truncate (Update Data) CI Name Trunc set to (Trim righthand characters of [Temp CI] Number of Chars 16)

If I remove this condition "AND Solution contains domain" it works. But doesnt compare b4 truncating.

Can someone help?

Thanks.
Amy
8 REPLIES
Robert S. Falko
Acclaimed Contributor.

Re: Using contains (AND) & (OR) Operator

Amy,

Can you use a wildcard and the equals operator, instead of Contains?

Is there an issue of upper or lower case letters?

-Josh
amykoh
Outstanding Contributor.

Re: Using contains (AND) & (OR) Operator

Hi Josh,

Apparently for the text field, it doesnt give me the option of using equals.

It has these operators: contains(AND), contains (OR), starts with, is (exactly) , is anything, is empty.

I tried using a wild card in the value field. Eg: *domain.com
with and without quotes, but to no avail.

Any other possible suggestions?

Thanks,
Amy
Ruth Porter
Acclaimed Contributor.

Re: Using contains (AND) & (OR) Operator

Hi amy,

I am not sure I really understand the issue.

Are you saying you want one field in a CI to have the FQDN and CI Trunc to have the this trimmed to remove the "@domain" and you are using a UI rule to do this? If so, I cannot see why this is failing so what does the log file say if you put rule debug on?

OR

Are you doing this so that the incident raised by sd_event can be linked to the correct CI? If this second reason, can you use an import mapping to resolve this; (use the reference to option)?

Hope this helps

Ruth
http://www.teamultra.net
amykoh
Outstanding Contributor.

Re: Using contains (AND) & (OR) Operator

Hi ruth,

More to the 2nd option.

I want the sd_event to map to the correct CI. The CMDB uses hostname to identify the servers.

But OVOW sends the FQDN to SD. Therefore I cant map it in and I am looking that the option to trim the FQDN hostname coming from OVOWso that i can map it in the CMDB.

For some servers, the CI is just the hostname (therefore no need to trim). This is why I thought I would use the contain (AND)/(OR) operator to check in the FQDN has the domain name.

If it does, then only trim. Else leave it coz it can be mapped to the CI.

Hope this helps you understand better.

Thanks

Amy

Ruth Porter
Acclaimed Contributor.
Solution

Re: Using contains (AND) & (OR) Operator

Hi Amy,

If what you really want to do is to get sd_event to map to the correct CI, can you have a field in the CI which has the FQDN or just the nodename and then make the mapping reference this field?

If not, can you explain what you do have as attributes of the CI

Hope this helps,

Ruth
http://www.teamultra.net
amykoh
Outstanding Contributor.

Re: Using contains (AND) & (OR) Operator

Hi Ruth,

OVOW CI Entry = myserver.domain.com

CI SearchCode in CMDB = MYSERVER

In order to map the OVOW CI to SD CI, i would need to remove 'domain.com'

If you could, can you explain to me how you see the referencing and mapping can work?..

My attributes of the CI are pretty standard ones:
- SearchCode
- Name
- Location
- Brand
- Category
- Status

Hope this helps

Thanks,
Amy
Ruth Porter
Acclaimed Contributor.

Re: Using contains (AND) & (OR) Operator

Hi Amy,

If you have a field which contains whatever OVOW might pass across, say call it OVOWName, then you can define a mapping which refers to this in the import mapping that sd_event uses. For example, for some of your nodes OVOWName would have the FQDN and for others just the node name.

So when you define the mapping for the CI in the incident, you then use the "A reference to item" option and select the OVOWName field.

This should mean that when sd_event uses this mapping it should work.

Hope this helps

Ruth
http://www.teamultra.net
amykoh
Outstanding Contributor.

Re: Using contains (AND) & (OR) Operator

Hi Ruth,

Thank you so much!!!....So far I've tested, it works!...

Cheers,
Amy