How to actual start date(work_start) and actual end date(work_end) work in change request?

HuChin
Tera Contributor

Hi everybody,

There is a requirement that i need disable the function that actual start date and actual end date auto capture in system, i found that it work in script include(ChangeRequestStateModelSNC_normal/standard/emergency) and protected. However, i can't find where to call this method(toImplement_moving() and toReview_moving()) . Can somebody tell me ?   

Thanks very much!

2 REPLIES 2

Lukasz Bojara
Kilo Sage

Hi HuChin,

The Actual start date and Actual end date are set by functions in Change Request State Model script includes. When state changes to Implement the Actual start date is populated, when state changes to Review the Actual end date is populated. This logic is scripted in the following script includes:

  • ChangeRequestStateModelSNC_standard
  • ChangeRequestStateModelSNC_normal
  • ChangeRequestStateModelSNC_emergency

As those are SNC script includes they are read-only and can not be changed, but all of them has secondary versions (they extend the SNC ones) that should be used if someone wants to overwrite the OOTB behaviour, those script includes do not have the SNC in the name: 

  • ChangeRequestStateModel_standard
  • ChangeRequestStateModel_normal
  • ChangeRequestStateModel_emergency

So you can write your own logic in the ones that extands the SNC scripts.

 

Just add to them those lines:

toImplement_moving: function() {
// comment, delete or change lines that fills the Actual start date
        //if (this._gr.work_start.nil())
            //this._gr.work_start = new GlideDateTime();
        return true;
    },

toReview_moving: function() {
// comment, delete or change lines that fills the Actual end date
        //if (this._gr.work_end.nil())
            //this._gr.work_end = new GlideDateTime();

        return true;
    },

 

Hope this helped.

Best regards,
Łukasz

Pavan Angadi
Tera Expert

Hi HuChin,

There are 2 business rules responsible to auto populate Actual Start Date and Actual End date, you can modify or add conditions accordingly based on requirement.

1. Change Model: Set work start

2. Change Model: Set work end

 

Hope this helps.
Thank you,

Pavan