5 Replies Latest reply on May 25, 2018 7:47 AM by AnthonyDowns

    Run as Internal Services ?

    AnthonyDowns Specialist

      Is it possible to do something like a "Run As" inside Heat?


      I'm trying to remove "Standard" from "Type" on the Change object because I only want users to use templates for a standard change. I can filter out Standard using a constraint like $(if CurrentUserRole != "Admin" then "Standard" else "") but it makes the templates unusable if i do. I was hoping for something similar to a "Run As" for the templates to be ran as internal services so that standard is in the pick list.


      Any ideas?

        • 1. Re: Run as Internal Services ?
          AlasdairRobertson ITSMMVPGroup

          That is not possible, only if it is called for example by a workflow who will runas the Internal Services account with Admin Rights.


          To achieve your goal add a Boolean field to your Change..something like IsStandard and a then add that as the constrain for the pick list similar to the Role constrain:


          ChangeType not Equal to $(if IsStandard then "" else "Standard")


          That way in your template if you set the IsStandard Flag you should now get the Standard Change Type.


          Please test in Staging this is from memory as I don't have a system to hand

          1 of 1 people found this helpful
          • 2. Re: Run as Internal Services ?
            AnthonyDowns Specialist

            Thanks Alasdair, this was a good starting place but I can't get it to work as intended. Using this method i'm assuming I would have to create a relationship on the ChangeTypeofChange object to Change, so that I could check that field in the constraint? How would you create the relationship between this two objects? All the variations i've tried have not worked.


            This is what I changed the constraint to.

            $(if [Change#.ChangeTypeOfChangeAssocChange]IsStandardChange == true  then ""  else "Standard")

            • 3. Re: Run as Internal Services ?
              AlasdairRobertson ITSMMVPGroup

              I don't think that a relationship is need is needed, I will run up an example for you.

              • 4. Re: Run as Internal Services ?
                AlasdairRobertson ITSMMVPGroup

                I got it working here are the steps:


                • Add a new initialisation business rule to change and set the IsStandardChange field to false (this is an ootb field which I cannot see being used else where if you would rather create a new Boolean field)
                • Update the TypeOfChange of ChangeTypeOfChange picklist (this is the one supporting the TypeofChange field)
                  • Use this expression: $(if [ValidationList]IsStandardChange then "" else "Standard")
                  • Note that it is a Not Equal To expression
                  • The [ValidationList] function allows us to capture and use a value from the current object/form in this case change


                • On your template for a standard change you now can add the field IsStandardChange and set it true so the Standard Type is now available, it also means a standard change can only be raised via a template or quick action setting this boolean value or the change will fail to save.


                Shout if you get stuck.

                • 5. Re: Run as Internal Services ?
                  AnthonyDowns Specialist

                  I always forget about using ValidationList...


                  Thank again AlasdairRobertson !