We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Create a release record from backend script and apply a template to it

RC19
Tera Expert

Hi all, I have below requirements in Digital Product Release:

 

1. I want to create a release record from background script and apply a release template to it. But on the release record I could not see any particular field which stores this template value, so I am not sure how to apply it.

2. I want to create a change request from backend and attach it to the release record. there is no field on change request which stores release record value.

 

How to do so? please help.

1 REPLY 1

Sai Teja1
ServiceNow Employee

1. You can invoke the create release function from background script.

Run this from bg: 

new sn_dpr.Release().createRelease(payload);
This same call is performed by the rest api as well (for reference).
/sys_ws_operation.do?sys_id=5540c7734fe1e150cab305d4d4ad481b
 
Use below docs for checking payload properties.

https://www.servicenow.com/docs/r/api-reference/rest-apis/digital-product-release-api.html

 

2. For change request, I'm not sure which version of DPR you are using, but you can attach and existing change to a release from within the dpr workspace. Simply click on Add on the change request page.