Skip tasks [MA] depending on the value of user prompt
When they make an request they have to fill the prompts - fields:
1. Device number
2. What to do (enumeration list) with service, values:
2.1. Turn on and turn off
2.2. Only turn on
2.3. Only turn off
3. Turn on date - wisible only where option 2.1 and 2.2 was choosen (invisible when choose option 2.3)
4. Turn off date - wisible only where option 2.1 and 2.3 was choosen (invisible when choose option 2.2)
My serivce template include 2 Manual acctivities:
MA1. Turn on date
MA2. Turn off date
How to, in simple way, to: skip/cancel/don't register unnecessary activity - according to value choosen from list?
I try to make dependent prompts and map it into status of activity but in map window, there aren;t any option to set default value for field with MA status.
Is there other option than PS activity or is PS only option, could someone give some script, help?
Best Answers
-
Leigh_Kilday Member Ninja IT Monkey ✭✭✭✭We do this using Orchestrator and I'm currently working on converting that to SMA.
My SCORCH runbook works like so:- Runbook parameters include "TitleMatch" string.
- The "TitleMatch" parameter is mapped to a user input.
- I place each of these runbooks in an SA. The title of the SA will contain one of the expected values for "TitleMatch".
- When run, the runbook will find its parent SA and compare its title with "TitleMatch". If it is the same, no action is taken, otherwise skip the SA.
- Occasionally we'd end up with emails being generated from activities within a skipped SA because the workflow kicked them off before it skipped the SA's child activities. To fix this, I retrieved all child activities of the SA and set them to Skipped rather than relying on the workflow t get it right.
- Originally I was deleting the unnecessary paths, but SCSM doesn't handle moving between the remaining Sequence IDs well, and we'd end up with no active activities.
5 -
Adam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭Agree with both comments so far. Recently built out a SR with a portion of it looking like:
1. SMA Runbook
2. Parallel Activity
3. Two Contained Sequential Activities
4. Different numbers of Manual Activities within each SA path
The SMA runbook that precedes all of this marks one of the Sequential Activities as Skipped, thus by the natural order of SCSM process only a single Sequential Activity moves to In-Progress.
I've long held the habit of having a "Prepare-xxxxxxx" style runbook as one of the first activities in a template that does nothing more than shape the flow of the request after submission.
5
Answers
My SCORCH runbook works like so:
- Runbook parameters include "TitleMatch" string.
- The "TitleMatch" parameter is mapped to a user input.
- I place each of these runbooks in an SA. The title of the SA will contain one of the expected values for "TitleMatch".
- When run, the runbook will find its parent SA and compare its title with "TitleMatch". If it is the same, no action is taken, otherwise skip the SA.
Gotchas1. SMA Runbook
2. Parallel Activity
3. Two Contained Sequential Activities
4. Different numbers of Manual Activities within each SA path
The SMA runbook that precedes all of this marks one of the Sequential Activities as Skipped, thus by the natural order of SCSM process only a single Sequential Activity moves to In-Progress.
I've long held the habit of having a "Prepare-xxxxxxx" style runbook as one of the first activities in a template that does nothing more than shape the flow of the request after submission.
Now you'll create an SCSM template based on this SMA runbook. So leaving the SMA Portal and heading back to Service Manager:
Library -> New Template -> SMA Runbook class
The runbook you'll use is the one you recently published in the SMA portal. You can now map properties into it. In this example, you'd map the Work Item ID to the RunbookID parameter. Now when the Runbook Activity is called, it kicks off the SMA runbook with the Work Item ID being fed in as a parameter. But you still aren't done yet.
With the new Runbook Activity, go back to your template that you're building your process for and add a new activity. You can now select the runbook activity template you just created and place it somewhere in your process stream. Beginning. Middle. End. Wherever you want/need.
NOTE: This isn't a fully functioning runbook. It's more of an example of what the PowerShell would look like/a general idea of how you could go about this with SMA and the Cireson SMA Connector. I should add, there is a Cireson support KA roughly outlining the same thing here https://support.cireson.com/KnowledgeBase/View/18#/. Since you're just getting started, I'd strongly advocate for getting SMlets installed and begin trying to perform simple Get operations against SCSM via PowerShell. There are a lot of articles on SMlets from Travis, here's one that should help you get started: https://blogs.technet.microsoft.com/servicemanager/2011/04/21/using-smlets-beta-3-post-1-using-get-scsmobject-get-scsmclass-to-dump-data-from-scsm/
If you're still hazy on any of this, I can certainly expand further.