Rollback with sysid or scope id in CICD?

Ct111
Tera Sage

Hello community members,

 

Has anyone worked on CICD rollback functionality in Servicenow ?

 

Currently, I see two subflows available for rollback

one with sysid and other with scope id however the functionality is not working as expected tested multiple times with configurations but no clue . There is not even enough post or articles with respect to that.

 

Hence, if anyone has worked upon it please let me know your thoughts .

 

Regards,

1 ACCEPTED SOLUTION

Ct111
Tera Sage

Finally got solution of this after doing multiple rounds of testing on some other subflows like Batch INstall , to understand  how  the entire process of how CICD subflows works.

 

I found ServiceNow documentation for CICD piece bit inadequate.

However, I will share my learning. I hope someone, someday will benefit from it.

 

 

So the entire cicd for rollback piece works like this

 

Once you make chances in source instance in custom application for latest version and Submit it (for publishing)

A deployment request is created in target instance . And in that by default approvals for AES group is generated.

Once you approve the request and make the deployment request as close published , it doesnt update the 

application to the latest version automatically at that instant .

Rather, you have to go to  "My Company Applications"  and search your custom

application and there you will see ( an orange dot appearing in your application) which is indication of 

various versions available , so once you select the latest version you need to select update and then fill next popup select option to continue with INSTALL . Once you do this then the latest version is installed at that moment.

This is very important step.

 

Because while working on Rollback with ID , you will mention the older version in  setup. But 

the real fact is it is already on the old version since you didnt install the latest version . HEnce,

your rollback will fail multiple times with different reason.

-----------------------------------------------------------------

 

 

 

 

View solution in original post

5 REPLIES 5

Paige Duffey
ServiceNow Employee
ServiceNow Employee

In the subflow there are a couple of logging opportunities upon failure. Have you checked those logs in the flow execution details? If so, what errors are you seeing?

Ct111
Tera Sage

Hi Paige,

Thanks for response.

 

I checked those logs but somehow I am not sure what needs to be done to fix that.

 

For example : 

Error received in one of the testing was like below:

status 3

status label : Failed

Error : empty

status message : This context is not the most recent recorded:CICD initiative , most recent context : some other custom app name.

 

I am not sure why this is coming despite providing correct app sysid , version to rollback to and url of the destination where it needs to rollbacked is correct..

 

 

Let me know your thoughts.

 

Paige Duffey
ServiceNow Employee
ServiceNow Employee

Ultimately this is looking at the Rollback Contexts (sys_rollback_context) table. Try looking at that table and locating the item you are attempting to rollback. Ensure that the context is there. If you try to manually roll it back from that record do you run into the same or a similar issue? Have you tried to roll back multiple applications and run into the same issue? 

Ct111
Tera Sage

 Hi Paige,

Can't see anything related to the that item in Rollback context table (in source instance).

Yes  i did try testing " Rollback with id/scope " for different custom applications but it didnt work.

 

Error I think is pretty much similar in all cases .

 

Note : I did try rollback of one of my sample app in target instance via information given in this documentation 

LINK

since oob rollback flow was not working but that reflected only in that instance it didn't propagated to source instance.

 

Let me know your thoughts, also if you can point me to some support article with respect to handling CICD errors,

that would be helpful.