Portal add MA to SR Task

IT MonkeyIT Monkey O.G.
edited May 2016 in Cireson Uploads

Enhancement: Add Manual Activity to a Service Request. 

Steps to Complete:

  1. Copy the .js contents into your CiresonPortal\CustomSpace\custom.js file.
  2. Copy the customtasks.addma.html file to your CiresonPortal\CustomSpace folder.
  3. Refresh browser.
  4. Open a Service Request and click the “add ma” task.

Notes:

  1. f the Service Request is Completed, the Add MA task will not show up.
  2. If there aren’t any activities it will disable the “Add Activity After” drop-down.
  3. The “Add Activity After” drop-down will pull in only the In Progress Activity and all subsequent activities.  This is so someone can’t add an Activity out of place.
  4. If they select a Parallel Activity a checkbox will appear that gives them the option to add the Activity within the Parallel Activity.  If the Parallel Activity is In Progress, the Manual Activity will be set to In Progress.  If the Parallel Activity is not In Progress, the Manual Activity will be set to Pending.

Download the attached .zip file below.

Comments

  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭

    This doesn't work for us.

    Our custom.js file calls js scripts from a folder for each task. I placed the js code and html file into this folder and add into the custom.js file to call for it, the "add ma" task shows under Tasks but when I click it I see some questions showing up at the bottom of the page, kind of hard to read. We should get a pop up window?

  • Michael_BaldryMichael_Baldry Customer Adept IT Monkey ✭✭
    Did you adjust the URL for the template to take your file structure into account? By default, it's looking for it right in the root of CustomSpace. If you adjust the bolded section below, it should pop up with a window.

    //use requirejs to load the HTML template first
    require(["text!/CustomSpace/<your folder name here>/customtasks.addma.html"], function (template) {

    OR

    Just store the HTML file in the root of your CustomSpace directory. Either one of those should fix it.
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    Yes. I adjusted the code to look for the template in the right folder. We are on V3, I will revisit it after we upgrade to V4 this weekend.
  • R_DelawderR_Delawder Member Adept IT Monkey ✭✭
    Nice script it works well. With some easy minor modifications it can be adjusted to work with review activities as well. Something to note: the function is not self contained as provided so if you modify to work with additional classes (i.e. Change request) be sure to move the closing bracket for the function to make it encompass the entire script.
  • Christopher_CarverChristopher_Carver Customer Adept IT Monkey ✭✭
    This script only works for me when a SR already has an activity in it. I get the standard pop up asking me where to place the MA as expected. However if there are no activities in the SR, the "add ma" doesn't add a manual activity. I am on Portal version 4.0.1. I have tried this on Edge, IE 11, latest Firefox and latest Chrome releases. 

    Thank you
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    @IT Monkey 

    This doesn't work if the SR has no activity. Any way to make it work with no activity in SR? 
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    This works. Thank you. Any way to make it add RAs to SRs or CR?
  • R_DelawderR_Delawder Member Adept IT Monkey ✭✭

    Yes with some minor modifications I have attached what I did to the script to use in our environment. (I copied the text out of the custom.js and put it into a plain txt file) the other 3 files are the dependent html files.

    it will allow you to add manual, review or parallel activities to SR or CR. (you can easily take out sections if you don't want them to have the ability to add all types.)

  • R_DelawderR_Delawder Member Adept IT Monkey ✭✭
    * added the script at end to hide the task from non analyst
  • Adrian_MataiszAdrian_Mataisz Customer Advanced IT Monkey ✭✭✭
    @R_Delawder  Thank You .I'll give it a try. 
  • TENA_ROCA_DiegoTENA_ROCA_Diego Customer IT Monkey ✭
    We found the ability to add RAs from quick task pane extremely useful for our operators, but this doesn't seem to work anymore. RAs are added fine but have no approval condition so approving them keeps them In progress status. 

    Is anyone still using this? 


  • Christopher_CarverChristopher_Carver Customer Adept IT Monkey ✭✭
    We are using this.

    Also to fix the issue if there are no existing activities. You will need to find all of these lines:
        console.log (startpos + " - " + vm.Activity[startpos].Title)

    And surround it with a simple range check.
    if (length > 0 ) {
        console.log (startpos + " - " + vm.Activity[startpos].Title)
    }

    I'm new to JS, so I'm self-learning. I opened the web console and saw a failure where vm.Activity[startpos] is out of range, because there are no existing activities. Once I made this change to the script, it started working as designed.




  • Davin_ClouthierDavin_Clouthier Customer Adept IT Monkey ✭✭
    edited October 12

    Edited* Realized my post wasn't relevant to the topic

Sign In or Register to comment.