IT Monkey:   Click Here to Help Me Build the Agenda for Upcoming Cireson Webinars!

Javascript Add Approver to RA

Davin_ClouthierDavin_Clouthier Customer Adept IT Monkey ✭✭

Hello Community,

I am wondering if anyone has any insight on how to do this, I am guessing if I dig deep enough in the portal I will find how the Add button within the RA works, right now I am making a task for approver adding, and I was wondering if anyone has attempted this before I get too deep into the portal source. Any help, suggestions or ideas is much appreciated!


Best Answer

  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    Accepted Answer
    @Davin_Clouthier
    The viewModel for activities and the reviewer are actually fairly complex.  I have written some fairly imperative code that should do what you need.  You will, however, have to get the user object for the reviewer and the activity object from the pageForm.viewModel.Activity array. 

Answers

  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
    Hi,

    just to be sure - you just want to add a reviewer via JavaScript?

    How should the reviewer be selected ? (if it is always the same reviewer - it could be included in the template), is the Review activity already there, or should the activity also be added at the same time ?

    To get a better understanding of your requirement - why do you not use the out-of-the-box functionality ?

    Depending on this, the pageform.viewmodel object is a good starting point and the "/api/V3/Projection/Commit"  API call should be helpful, too

    regards


  • Davin_ClouthierDavin_Clouthier Customer Adept IT Monkey ✭✭

    Yeah maybe a bit more info might be in order, we used to have and use the template system but we realized the static world was becoming a huge headache to where we would have 100s of templates mass deleting of improperly selected templates on tickets, so awhile ago we opted to implement a dynamic world where the CR is blank and the template is applied from javascript and ma's and ra's can be added on the fly from the portal page, sothe adding MA and RA's to add to the ticket just fine using the commit api, just was having some issues getting the reviewer to add properly, if that makes sense

  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    Accepted Answer
    @Davin_Clouthier
    The viewModel for activities and the reviewer are actually fairly complex.  I have written some fairly imperative code that should do what you need.  You will, however, have to get the user object for the reviewer and the activity object from the pageForm.viewModel.Activity array. 
  • Davin_ClouthierDavin_Clouthier Customer Adept IT Monkey ✭✭
    Thanks alot James, this pointed me in the right direction. Much appreciated
  • Matthew_longMatthew_long Customer IT Monkey ✭
    Hi, this thread is great as we are in the same position @Davin_Clouthier was previously. We have a requirement to add Review Activities and Manual Activities to work items and have been able to get this task on the portal for analysts. However we have ran into the issue of adding an approver to a review activity!

    @james_kleinschnitz we are struggling to get our heads around where to put this script (does it go in the custom.js?) 

    Sorry for the post, we are new to Cireson/SCSM and are having issues

  • Matthew_longMatthew_long Customer IT Monkey ✭
    Go the in the end... thanks
  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    @Matthew_long
    Just following up with this, anything else I can help out with here?
Sign In or Register to comment.