activity.result in workflow run script activity

Joshuu
Kilo Sage

Hi All,

 

I have written the below script in the workflow run script activity. The change is closed and it is successful but it is not moving further from this activity. what could be the reason? Could you please assist?

 

 

var CR = new GlideRecord('change_request');
var CR = new GlideRecord('change_request');
CR.addQuery('parent', current.sys_id);
CR.query();
if (CR.next()) {
    if (CR.state == '4') {
        activity.result == 'Canceled';
    } else if (CR.state == '3') {
        if (CR.close_code == 'successful')
            activity.result == 'Successful';
        else
            activity.result == 'Failed';
    }
}

 

 

Thanks & Regards.

7 REPLIES 7

Hi @Joshuu ,

This is more confusing. So when a RITM gets closed you need to create a change request. Is that your requirement?

If yes then you can update your code as below:

 

Also do share complete picture of your workflow to understand this better

var chg = new GlideRecord('change_request');
chg.initialize();
chg.short_description = current.short_description; //Similarly add other fields as required.
chg.insert();
Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi @shloke04 ,

 

CHG is already getting created all working fine. But once the change is completed here checking the status of the change with the run script activity.

Hello @Joshuu ,

 

Can you put some logs and share the results with us?

 

Regards,