microsoft / azure-pipelines-extensions

Collection of all RM and deployment extensions
http://www.visualstudio.com/explore/release-management-vs
MIT License
278 stars 422 forks source link

ServiceNow extension using wrong API to retrieve Change Templates? #995

Open jrbrewin opened 2 years ago

jrbrewin commented 2 years ago

The Service Now Change Management extension has the option to retrieve Standard Change templates, allowing change requests to be raised based on a pre-existing template. However, given the documented requirements for user permissions within Service Now it is not possible to retrieve Standard Change templates using the API currently specified in the extension.

the API endpoint is defined in vss-extension.json @ line 140. This hits https://INSTANCENAME.servicenow.com/api/now/table/sys_template?sysparm_query=table=change_request^active=true&sysparm_fields=sys_id,sys_name

when querying this API with a user with the permissions defined in the extension documentation I get the following response

{
    "result": []
}

Service Now's official API documentation states a different API to use for querying the list of Standard Change templates - https://INSTANCENAME.servicenow.com/api/sn_chg_rest/v1/change/standard/template?sysparm_query=active=true

when querying this API with the same user with the permissions defined in the extension documentation I get the a list of active Standard Change templates. In our specific Service Now instance, currently on Quebec, I receive ~10,000 lines of json.

matthewcclark commented 1 year ago

Also experiencing the same issue, where the templates don't populate. Is this being looked at as I see this was originally raised almost 2 years ago?