catalog task variables only visible on the task ?

emerkle
Kilo Contributor

Question: We have a catalog Item and multiple catalog task in a workflow. We are looking for how we can show variables on the catalog task and not the catalog item. We are looking to create a checklist for the person working the cat task but don't want it rolled up to what the self service user can see in the catalog item.
Wiki also does not explain these field is the variable forms so that doesn't help
(Visibility, Visible Elsewhere)

8 REPLIES 8

The problem I've seen is that people with roles will want to review a requesteditem and the variables will be need to visible on there so they can see what details have been entered e.g. Shared drive "XYZ" for User "Bob Jones" for example.



We've had to make all variables read only at requested Items level (as in screenshot) because otehrwise they can be view and amended which = BAD .



To fulfill this via UI policies mean one policy per (Cat Item & requested Item) and one for catalog tasks as well..   Because your support teams are likely to want to view what was entered by the end users based on what answers they give. Laptop type XYZ, systems access at what level etc etc.   BUT you don't want them to amend those values either.



There will be times when their tasks may simply be a case of closing it down successful or not...   But if you want to give them a variable that allows for further workflow conditions to apply you need a sepparate variable for them to enter.



I agree that work instructions should be included in the team and managed by the team where possible (I'd use templates to cat task creation perhaps)



My two pennies worth anyway



Ben


i agree on the limitations and fields we want NEVER to change requested for approving manager etc are all held in variable sets we add to each item... those variable sets have a ui policiy making them read only at the catalog task level...



as far as modifying variables we debated this for a VERY long time.. and finally decided that at the TASK level it was ok for a tech to modify most variables as long as it is logged.. in point of fact it is desirable... for example say the customer choices a laptop that is out of stock and the fulfillment groups ships a different item... depending on how you are reporting on that you MAY want to have the tech change the variable ... this way if you want to know what was shipped you can report on that variable.



this Did require us to create a new br that logs any variable change to the items activity log so that if someone wants to know who changed the variable they can see it....



let me know if you want me to post that br... it is a bit long! <grin>


Ok sounds like a good idea..   There's a lot of ways to skin a cat I suppose (although I like cats )...



Also depends on how much you trust the guys doing the fulfilling and relationships with the business etc etc



That BR could be useful if possible to upload


ok this is a before BR that applies on update ONLY   on the   options <sc_tiem_option> table


filter conditions are value change



script is as follows   and this is a work in process.. for some types of variables it will return the sid only <lookup fields specifically> for most types of data i have it returning the actual value... if you need the value for a data type just update the case in the below script for that type of data.



_________________________________________________________________



    if (previous.value != current.value){


            var var_owner = new GlideRecord('sc_item_option_mtom');


            var_owner.addQuery('sc_item_option',current.sys_id);


            var_owner.query();


            if (var_owner.next()){


                    var itm = new GlideRecord('sc_req_item');


                    itm.addQuery('sys_id', var_owner.request_item);


                    itm.query();


                    if (itm.next()){


                          itm.work_notes = 'Variable updated: ' +   current.item_option_new.getDisplayValue() + ' , value changed from ' + getValues(previous.value,current.item_option_new) + ' to ' + getValues(current.value,current.item_option_new) + ' By ' + gs.getUserName();


//itm.description = 'test';


                          itm.update();


                  }          


            }


    }


function getValues(q_value,q_sid){


  var answer = '';


    var q_type = new GlideRecord('question');


    q_type.addQuery('sys_id', q_sid);


    q_type.query();


    while(q_type.next()){


    switch(q_type.type.toString()){



            case('5'):   // Select box


                                              var qc = new GlideRecord('question_choice');


                                              qc.addQuery('question',q_sid);


                                              qc.addQuery('value',q_value);


                                              qc.query();


                                              if (qc.next()){


                                                            answer = qc.text;


                                              }


              break;


              case('14'): //macro


                            answer = "Macro was changed";


                break;


                case ('15'):   //UI Page


                          answer = "UI Page was changed";


                break;


              case('18'):   //lookup select box   investigate this.


                                answer = q_value;


              break;


              case('21'): //list collectior investigate this


                                  answer = q_value;


              break;


              case ('22'): // lookup multiple choice   investigate this


                                answer = q_value;


              break;


              case('23'): //html


                                answer = "HTML was changed";


              break;


              case('3'): //Multiple choice


                                              qc = new GlideRecord('question_choice');


                                              qc.addQuery('question',q_sid);


                                              qc.addQuery('value',q_value);


                                              qc.query();


                                              if (qc.next()){


                                                            answer = qc.text;


                                              }


              break;


              case('8'): //reference  


                        var getReferenceDisplayValue = new GlideRecord(q_type.reference.toString());


                        if(getReferenceDisplayValue.get(q_value)){


                                answer = getReferenceDisplayValue.getDisplayValue();


                        }


              break;


                  default:


                          answer =   q_value;


            break;


  }


  if (answer == ''){answer = 'Null';}


  return answer;


}


}