AnsweredAssumed Answered

Refuse Reasign Button

Question asked by JFMelhorado on May 19, 2016
Latest reply on May 20, 2016 by JFMelhorado

Hello!

I need to change a status in an incident but I am facing some dificulties.

What I need:

When an incident is reasign to another user, if the reasignation is rejected, I need the incident to go to the previous state it was before the reasignation (before PTE-ACK).

 

What happens:

When an incident is reasign to another user, if the reasignation is rejected, the incident always goes to the same state (ACK).

 

Example:

An incident is asigned to an user and the incident state is WIP, then, if the incident is pending reasignation, goes from WIP to PTE-ACK (which is pending-reasign) but if the reasingnation is rejected then the state of the incident goes to ACK instead of WIP(which was the state before PTE-ACK).

 

I've buildt new macros, checked and corrected the spell code but the only thing that works for that button was this line in a form:

<input type="hidden" name="SET.status" value="ACK">

 

I've changed the value to 'WIP' and then only goes to WIP. I've commented the line to see if it would follow the macros and spell code but instead it stays always in the same state (PTE-ACK)

Then I've checked the java script code for the button:

 

ImgBtnCreate_internal( "btnres", "Rechazar Reasignacion", "refuse_asign()",true, 0, "n/a", -1, "ReAssign", "positive");

 

and the refuse_asign function:

 

// LABCA01 - ADDED TO REFUSE ASIGN

function refuse_asign()

{

  var query_str = cfgCgi +

        "?SID=" + cfgSID +

        "+FID=" + fid_generator() +

        "+FACTORY=cr" +

        "+PERSID=$args.persistent_id" +

        "+OP=UPDATE" +

        "+EDIT_HTMPL=request_status_change_refuse_asig.htmpl" +

        "+ACTIVITY_LOG_TYPE=ST";

               

<PDM_IF "1" == "${args.KEEP.IsPopUp:0}">

                    query_str += "+KEEP.IsPopUp=1";

 

But I don't really know javascript and I really could use some help!

 

Thanks in advance!

 

Best regards.

Outcomes