Highlighted
Respected Contributor.
Respected Contributor.
562 views

Auto close change task when chance is abandoned/withdrawn.

Jump to solution
Hello guys,
I would like to auto close change task when a change(Normal, standard, emergency) is abandoned, withdraw are cancelled. Currently it is asking to close task before abandoning/cancelling/Withdrawing. Please guide me on how to modify the workflow to bring this situation.

Thanks,
USSKT
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi TPRMT,

As you mentioned, when you abandon the chnage ( I'm assuming there is phase called abandon in change workflow), if that is the case the above script can be used to auto cancel teh task by just update in the script as:

trel['status']='30'; // 30 is the status code for "cancelled"
trel['current.phase']='Cancelled';
trel['closing.comments'] = 'Change Taks has been auto cancelled';

Thanks

Neo

View solution in original post

7 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi TPRMT,

Try placing the below script in trigger record of cm3r as:

Task_Status.JPG

if (record['category']=='Normal Change' && record['current.phase']=='Deployment') {

var trel = new SCFile("cm3t");
var query = "parent.change = \"" + record.number + "\"";
if ( trel.doSelect( query ) == RC_SUCCESS )
 {
  do
   {
     trel['status']='20';    // 20 is the status code for "Completed"
     trel['current.phase']='Deployment';
     trel['account.type'] = 'Common';
    trel.doAction("save");
   }
  while (trel.getNext() == RC_SUCCESS); 
 }
 }

Thanks

Neo

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hello Neo,

Thanks for the help. Do you want to me add "Set.Change.Task.Status" a new trigger to cm3r triggers? Because i don find one already in my SM. Attached the list of triggers that i have in my cm3r on 4- After update.

Please clarify me. Thanks.

USSKT.

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Hello Neo,

I have tried the steps you insisted. But the issue i have faced is,

1. I can only create change task during "Registration and Categorization" Phase or "Risk and Impact Analysis" Phase. 

2. After creating, when i move the ticket from any of the two phase to "Build and test" or "deployment authorization, it throws the error " the change cannot move a phase until following task are closed".

3. As you know i cannot create a valid task once the ticket is in "Deployment"/Build and test phase. 

 

So testing the code you provided is itself not feasible here. Please guide me on this.

 

Thanks for the effort to help me.

 

USSKT.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi TPRMT,

1. I can only create change task during "Registration and Categorization" Phase or "Risk and Impact Analysis" Phase. 

-  Its upto your process flow wherein tasks need to be introduced.

2. After creating, when i move the ticket from any of the two phase to "Build and test" or "deployment authorization, it throws the error " the change cannot move a phase until following task are closed"

 You can diable the validation from system by unchecking , refer to below screenshot: Pls not this is just an example , please align as per the workflow implemented in your enviornment.

SS.jpg

3. As you know i cannot create a valid task once the ticket is in "Deployment"/Build and test phase. 

Yes again it depends on the flow in your enviornmtn.

Above script will help you change the task status to closed so once the change is abondoned, let say in XYZ phase, in that phase follow the point 2 screenshot & allow the change request to pass from XYZ phase to Abandon phase. In the trigger records place this script and modify the script as :

if (record['category']=='Normal Change' && record['current.phase']=='Abandon') {

var trel = new SCFile("cm3t");
var query = "parent.change = \"" + record.number + "\"";
if ( trel.doSelect( query ) == RC_SUCCESS )
 {
  do
   {
     trel['status']='20';    // 20 is the status code for "Completed"
     trel['current.phase']='Deployment';
     trel['account.type'] = 'Common';
    trel.doAction("save");
   }
  while (trel.getNext() == RC_SUCCESS); 
 }
 }

 Thanks

Neo

Highlighted
Respected Contributor.
Respected Contributor.

Hello Neo,

 

Thanks for the help. Just a quick question on the same. Lets say when i abandon the change, i want to auto cancel the task that are in Planned, Ready, Assigned Status. How to acheive this please. 

Any help is much appreciated.

Thanks,

USSKT.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Hi TPRMT,

As you mentioned, when you abandon the chnage ( I'm assuming there is phase called abandon in change workflow), if that is the case the above script can be used to auto cancel teh task by just update in the script as:

trel['status']='30'; // 30 is the status code for "cancelled"
trel['current.phase']='Cancelled';
trel['closing.comments'] = 'Change Taks has been auto cancelled';

Thanks

Neo

View solution in original post

Highlighted
Respected Contributor.
Respected Contributor.
Thanks Neo. It worked
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.