Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
- List: JavaScript functions in the ScriptLibrary
- JavaScript function: addToGroup
- JavaScript function: checkAllowedOption
- JavaScript function: checkVersionString
- JavaScript function: isfileexist
- JavaScript function: isInGroup
- JavaScript function: removeFromGroup
- JavaScript function: returnGroupMembers
- JavaScript function: returnMyGroups
- JavaScript function: skipApproval
JavaScript function: isInGroup
Searches for one configuration item (CI) in a Configuration Management list or query group.
Syntax
lib.ciGrouping.isInGroup( ci, groupName );
Arguments
The following arguments are valid for this function:
Name | Data type | Required | Description |
---|---|---|---|
ci
|
String | Yes | This argument contains the CI record you want to search for in the group. |
groupName
|
String | Yes | This argument contains the name of the configuration group where you want to search for the CI. |
Return values
A Boolean value: true
or false
.
The function returns true
if the function successfully finds the CI in the list or query group. The function returns false
if it is unable to find the CI in the list or query group.
Description
This function is part of a system JavaScript and should not be directly modified.
This function searches for a CI in list or query groups and returns a Boolean value of true if successful.
Example
This example attempts to search for a CI in the following groups:
- A list group
- A query group
This example requires the following sample data:
- Create a list group containing one or more configuration items (for example, a list group called "test01" containing the configuration item "DEFAULT Phone 0001")
- Create a query group containing one or more configuration items (for example, a query group called "test04" containing the configuration items where type equals "telecom")
/* Create variables to store CI group name and the results of returnGroupMembers */ var targetCIGroup; var targetCI; var members; function findInGroup( ci, group ) { inGroupTest = lib.ciGrouping.isInGroup( ci, group ); if ( inGroupTest == true ) { print( "Success. Found " + ci + " in " + group ); } else { print( "Error. Could not find " + ci + " in " + group ); } } /* Test returnGroupMembers on a list group. */ print( "Now testing isInGroup on list group...\n" ); targetCIGroup = "test01"; targetCI = "DEFAULT Phone 0001"; members = lib.ciGrouping.returnGroupMembers( targetCIGroup ) print( "Looking for " + targetCI + " in " + targetCIGroup + "..." ); findInGroup( targetCI, targetCIGroup ); print( "The current members of " + targetCIGroup + " are:\n" + members ); /* Test returnGroupMembers on a query group. */ print( "Now testing isInGroup on query group...\n" ); targetCIGroup = "test04"; targetCI = "DEFAULT Phone 0006"; members = lib.ciGrouping.returnGroupMembers( targetCIGroup ) print( "Looking for " + targetCI + " in " + targetCIGroup + "..." ); findInGroup( targetCI, targetCIGroup ); print( "The current members of " + targetCIGroup + " are:\n" + members );
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-ITSM@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: