Have an issue with what is presumed to be a pre-compile showing Failed creating a parameter. The computers that fail in this manner report and do not retry the policy action. This happens to be a weekly policy action and the list of those showing grows week to week until stop the action and issue anew. Can take the list of failed computers and run the action anew as a one-time and it will work. Note despite checking that the setting exists, then that the value of the setting exists before trying to set the parameter it shows Failed. This isn’t the only pre-compile have ran into but it has been the one that has haunted me for years. Note Failed 4 lines into the action.
// get the agency abbreviation
if {exists setting “agency_abbreviation” of client}
if {exists value of setting “agency_abbreviation” of client}
Failed parameter “agency_abbrev”="{if exists setting “agency_abbreviation” whose (exists value of it) of client then value of setting “agency_abbreviation” of client else “Other”}"
else
parameter “agency_abbrev”="Other"
endif
else
parameter “agency_abbrev”="Other"
endif
Hm. I don’t see any reason that should be failing. I think the whole action could however be shortened to
parameter “agency_abbrev”="{(value of setting “agency_abbreviation” of client | "Other”)}"
If the client setting doesn’t exist or doesn’t have a value, that would trigger the “|” error handling and set the value to “Other”.
You might also set the action to “Retry on Failure” as well as “Reapply while Relevant waiting 7 days” for a weekly policy action. Otherwise a one-time failure would make it never retry.
1 Like
Appreciate the response. I have used that syntax but it didn’t prevent the events. I actually had it coded based off the client version where older client had what I documented and the newer clients had the | “Other” coding as an extra safeguard.
I do have both Reapply while Relevant waiting 7 days and Retry on Failure, however once it returns in the action status it won’t run again under that action.
I might just go ahead with your suggestion because all those statements building up to the final parameter assignment hasn’t helped. Nothing to lose at this point.
You can only set an action parameter once. I think there are cases where you are trying to set the parameter a second time (which will fail with error)
TRY:
parameter "agency_abbrev"="{if exists (setting "agency_abbreviation" whose (value of it != "") of client) then ((value of setting "agency_abbreviation" of client) as string) else ("Other")}"
Although, I rather like Jason’s better.