Home Cireson Uploads
image


IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.

DISCLAIMER

All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.


Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.

Dont forget to checkout solutions uploaded by our customers, partners and community members here.

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 Advanced 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 2017

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

  • Billy_WilsonBilly_Wilson Member Ninja IT Monkey ✭✭✭✭
    Any way to include IRs in this as well? Some folks use MAs in IRs.
  • Billy_WilsonBilly_Wilson Member Ninja IT Monkey ✭✭✭✭
    Nevermind, it was simply a matter of copying the current SR code and changing "SR" to "IR" and "ServiceRequest" to "Incident". had to add the fix for when there are no existing activities so thanks to @Christopher_Carver for that one :)
  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    @Billy_Wilson, I've tried the same thing and the MAs are getting added to the IR but they don't have a status and never change to 'In Progress'. Did you have to change anything else to get that to work?
  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    I got it. I had to add the following into the finalir.Activity.push sections to get it to give each MA a status on creation:

    "Status": {HierarchyLevel:0,HierarchyPath:null,Id:"11fc3cef-15e5-bca4-dee0-9c1155ec8d83",Name:"In Progress"},
  • Raymond_DidonatoRaymond_Didonato Customer IT Monkey ✭
    Anyone customize this further to include adding a support group and/or an activity implementer?  I just get undefined in my drop down list when I try, and I've been plugging away at it for a few hours hoping to stumble on the answer.

    My organization probably wouldn't have let me switch to the Cireson portal without this customization.  Of course, activities could've always been added by an admin or BA using the console, but where's the joy in that when the portal is already so good.  Add it in the base solution!
  • Tracie_MarshallTracie_Marshall Customer IT Monkey ✭
    I recently updated the portal to version 8.12.6.2016 and now when analysts try to add MA within a PA it doesn't work. I was wondering if anyone had a similar issue or new how to resolve it? Thanks!
  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    @Tracie_Marshall - I'm seeing the same thing in 8.12.9.2016. I'm working through some CSS issues and then will see if I can figure out what is going on.
  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    I have confirmed that the new MA is added to the PA in the pageForm.ViewModel and the api call to commit the change is returning success. Everything looks okay to me; but the new MA isn't actually committed.

    I'm wondering if there was a change to the commit api made in the latest releases.
  • Wendy_CraigWendy_Craig Customer IT Monkey ✭
    Has anyone experienced MAs adding in random places, NOT after the activity you select?
  • Marc-Andre_LafleurMarc-Andre_Lafleur Customer Adept IT Monkey ✭✭
    edited March 2019
    Hey @Wendy_Craig and @Nick_Flint
    I fixed both of these issues in my version of the Add Activity task. Here's the link if you want to try it: Add Activity Task
    Make sure to take the latest version available in the latest comment.
Sign In or Register to comment.