Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

Change Request Types Accepted by Ansible Collection for SNOW

RadeshS
Mega Contributor

Hello,

 

We're trying to use the Ansible Collection for SNOW; however, it appears that the change request role only allows "Emergency, Normal or Standard".

 

Our SNOW team requires us to use something I believe to be custom, "Technology Change".

 

Our use-case is intended to provide a fully automated mechanism to make some changes on devices after the change has been approved. 

 

The flow is:

1. User Submits the parameters they want.

2. If it validates we submit a change request (this works)

3. An approver reviews the change and schedules it

4. When it is in the "Scheduled" state, Red Hat Event Driven Ansible (EDA) will pick it up

5. EDA will call a workflow template to implement the change...


If we pass, "normal" the flow works as described. If we pass "Technology Change" the change gets submitted, but it's in a state where we can't do anything with it.

 

We're using the same CI in both cases (Normal and Technology Change), but the process just doesn't seem to put the change into a condition where it can be approved and scheduled. When I look at the payload, it seems that type is null. Additionally, when I look at what I believe to be the code (https://github.com/ansible-collections/servicenow.itsm/blob/main/plugins/modules/change_request.py), it seems to reenforce that we can only pass one of the 3 types listed.

 

If we're understanding this correctly, what reasons might there be against allowing custom types. I'd imagine that we can submit a request to allow custom types, but I'm not sure if that makes sense so wanted to get the take of someone who might be more familiar.

 

Thank you

3 REPLIES 3

JenniferRah
Mega Sage

From what I have experienced with Ansible, they limit the API calls they make to ServiceNow to just certain variables. I'm not very familiar with Ansible beyond that, but it appears in your use case that Ansible is picking up something from ServiceNow. Are you driving that process from ServiceNow or is Ansible making regular calls to see if something is available? 

 

Whatever the case, if Ansible has to make a call to SN using the custom model, it won't work. I would suggest trying to find a way around it having to use that field, if possible. It should be able to open a change by the change number or sys_id and not have to set the model, so perhaps you could get the information you need without referring to the model?

RadeshS
Mega Contributor

We're initiating the change request using Ansible. We can post any type of change, but it seems that the only acceptable types (defined by the Ansible Collection) are Emergency, Normal or Standard. When Standard is passed things work as expected.

 

I looked at the collection in GitHub and was wondering if it made sense to submit a PR to request that custom types be allowed.

 

I'm not well versed in ITSM best practices, so maybe the allowed types are what make sense and anything beyond is really company process. 

Honestly, I don't understand why it's limited. I'm sure they have their reasons, but it really makes it less usable in the real world. Allowing for custom values would seemingly improve their process in my opinion.