Ian_Geglia_179

Define Agent Group via script

Discussion created by Ian_Geglia_179 on Feb 1, 2017

It is not possible to use a promptset to define an Agent Group because the Agent Group is resolved before the prompt is done.

You can work around this using the script below on the pre process tab:
:SET &IS_OVERWRITE_GROUP# = GET_OBJECT_TYPE("&OVERWRITE_AGENT#")
:IF &IS_OVERWRITE_GROUP# = "HOSTG"
: SET &HND# = PREP_PROCESS_HOSTGROUP(&OVERWRITE_AGENT#,"*",BY_RULE)
: PROCESS &HND#
:   SET &OVERWRITE_AGENT# = GET_PROCESS_LINE(&HND#,1)
:   SET &STATUS# = GET_PROCESS_LINE(&HND#,2)
:   PRINT "HEADER: overwrite agent with agent from AGENTGROUP: >&OVERWRITE_AGENT#< - Status: >&STATUS#<"
:   IF &STATUS# = "Y"
:     TERM_PROCESS
:   ENDIF
: ENDPROCESS
: CLOSE_PROCESS &HND#
:ENDIF

Outcomes