Service Plan Rules - Examples

Modified on Wed, 14 Jan at 5:57 PM


Evaluator Rule Examples and Concepts

Evaluator rules in ManagementStudio ESM Plans allow you to assess objects using field values, readiness metrics, Active Directory (AD) group membership, and custom logic. The examples below illustrate common rule definitions and patterns, demonstrating how rule sets can be constructed to meet various workflow requirements.


Rules can be combined using logical operators such as -and and -or, with grouping available via parentheses ( ) for complex condition evaluation.


To optimise both performance and accuracy, restrict each ESM Plan to a relevant data set, ensuring rules apply only to pertinent objects.


Publish Events can be triggered by rule outcomes, automating processes and reducing manual intervention.


TABLE OF CONTENTS


Date Calculation Rules

Rule NameRule TypeData LocationOperatorCriteria
Has a date setFieldDeployUnitSlotStart!=[Blank]
Has no date setFieldDeployUnitSlotStart==[Blank]
More than 10 days to go (Inclusive)FieldDeployUnitSlotStart>=[Today + 10]
Less than 10 days to go (Inclusive)FieldDeployUnitSlotStart<=[Today + 10]
More than 10 days ago (Inclusive)FieldDeployUnitSlotStart>=[Today - 10]
Less than 10 days ago (Inclusive)FieldDeployUnitSlotStart<=[Today - 10]
In the futureFieldDeployUnitSlotStart>[TimeStamp]
In the pastFieldDeployUnitSlotStart<[TimeStamp]
Older Than This Time YesterdayFieldDeployUnitSlotStart<[Timestamp -1]
Is Between 5 & 10 Days to goFieldDeployUnitSlotStartIs the DayBetween [Today + 5] & [Today + 10]
Not Between 5 & 10 Days to goFieldDeployUnitSlotStartNot the DayBetween [Today + 5] & [Today + 10]
Is Between 5 & 10 Days agoFieldDeployUnitSlotStartIs the DayBetween [Today - 5] & [Today - 10]
Not Between 5 & 10 Days agoFieldDeployUnitSlotStartNot the DayBetween [Today - 5] & [Today - 10]
Three days to go between 1pm & 7pmFieldDeployUnitSlotStartIs the DayBetween [Today + 3 @13:00] & [Today + 3 @19:00]
Three days ago between 1pm & 7pmFieldDeployUnitSlotStartIs the DayBetween [Today - 3 @13:00] & [Today - 3 @19:00]
DeployUnitStart = 2021-01-25FieldDeployUnitSlotStartIs the Day2021-01-25
Compare two datesCompare FieldsDeployUnitSlotStart<=DU:EndDate

Explanations

  • Has a date set: Passes if the field contains any value.
  • Has no date set: Passes if the field is empty.
  • More than 10 days to go (Inclusive): True if the date is at least 10 days in the future.
  • Less than 10 days to go (Inclusive): True if the date is within the next 10 days.
  • More than 10 days ago (Inclusive): True if the date is at least 10 days in the past.
  • Less than 10 days ago (Inclusive): True if the date is within the last 10 days.
  • In the future: The field date is after the current timestamp.
  • In the past: The field date is before the current timestamp.
  • Older Than This Time Yesterday: The field date is before the same time on the previous day.
  • Is Between 5 & 10 Days to go: The field date is between 5 and 10 days ahead.
  • Not Between 5 & 10 Days to go: The field date is outside 5 to 10 days ahead.
  • Is Between 5 & 10 Days ago: The field date is between 5 and 10 days ago.
  • Not Between 5 & 10 Days ago: The field date is not between 5 and 10 days ago.
  • Three days to go between 1pm & 7pm: The field date is exactly 3 days ahead, between 13:00–19:00.
  • Three days ago between 1pm & 7pm: The field date is exactly 3 days ago, between 13:00–19:00.
  • DeployUnitStart = 2021-01-25: Passes if the date matches 2021-01-25.
  • Compare two dates: Passes if DeployUnitSlotStart is earlier than or equal to DU:EndDate.



Detail Field History Rules

Rule NameRule TypeData LocationOperatorCriteria
Before 5 days agoFieldIsArchived_Modified_Date<[Today -5]
Modified By AdminFieldIsArchived_Modified_ByLikeAdmin
Previous ValueFieldIsArchived_Modified_ValueLikeFalse

Explanations

  • Before 5 days ago: The record was modified more than five days ago.
  • Modified By Admin: The record was modified by a user whose name includes "Admin".
  • Previous Value: The previous value of the field contained "False".



Cross Module Rules

Rule NameRule TypeData LocationOperatorCriteria
Apps CheckFieldAP:TitleLikeApp #33038: Adobe Reader and Acrobat
Machine CheckFieldDV:ProcessorLike3.4 GHz
DeploymentUnit CheckFieldDU:ShortLocationLikeNuneaton
MailBox CheckFieldMB:MailName1LikeTeamMailBox1
Bespoke CheckFieldBK:BespokeName1LikeMyBespoke

Explanations

  • Apps Check: Passes if the application title contains “App #33038: Adobe Reader and Acrobat”.
  • Machine Check: Passes if the processor field contains “3.4 GHz”.
  • DeploymentUnit Check: Passes if the short location is “Nuneaton”.
  • MailBox Check: Passes if the mailbox name is “TeamMailBox1”.
  • Bespoke Check: Passes if the bespoke name field contains “MyBespoke”.



AD Group Rules

Rule NameRule TypeData LocationOperatorCriteria
Is a CCTV recoding PCAD GroupDC=Enterprise,DC=LocalIs InGlobal_CCTV_Devices
Is not a Factory PCAD GroupDC=Corp,DC=LocalIs Not InGlobal_Factory_Devices

Explanations

  • Is a CCTV recoding PC: Passes if the device is a member of the Global_CCTV_Devices group within the Enterprise domain.
  • Is not a Factory PC: Passes if the device is not a member of the Global_Factory_Devices group within the Corp domain.



Check Box List Rules

Rule NameRule TypeData LocationOperatorCriteria
Ben is CheckedFieldUMCT1\Tab 1\Check MELikeBen
Dave is CheckedFieldUMCT1\Tab 1\Check MELikeDave

Explanations

  • Ben is Checked: Passes if “Ben” is present in the Check ME field.
  • Dave is Checked: Passes if “Dave” is present in the Check ME field.


Example Logic

  • OR logic:[Ben is Checked] -or [Dave is Checked] — Passes if either value is collected.
  • AND logic:[Ben is Checked] -and [Dave is Checked] — Passes if both are checked.
  • Grouped evaluation:([Ben is Checked] -or [Dave is Checked]) -and [Some Other Rule]
Example NameLogic Expression
Basic OR[Ben is Checked] -or [Dave is Checked]
Basic AND[Ben is Checked] -and [Dave is Checked]
Grouped OR inside AND([Ben is Checked] -or [Dave is Checked]) -and [Machine Check]
Two Groups([Ben is Checked] -or [Dave is Checked]) -and ([Apps Check] -or [MailBox Check])
Deep Nesting(([Ben is Checked] -or [Dave is Checked]) -and [Machine Check]) -or [Bespoke Check]
Exclude Using Opposite Rule([Ben is Checked] -or [Dave is Checked]) -and [Is Not a Factory PC]
Complex Real‑World Example(([Apps Check] -and [Machine Check]) -or ([MailBox Check] -and [Bespoke Check])) -and [Is Not a Factory PC]



Readiness Examples

Rule NameRule TypeData LocationOperatorCriteria
Apps Are ReadyFieldAR:IsReady==true
Has Any AppsFieldAR:Total>0

Explanations

  • Apps Are Ready: Passes if all apps linked to the record are ready.
  • Has Any Apps: Passes if at least one app is assigned.



Readiness More Details

Readiness rules let you evaluate the status of related modules using readiness metrics. Use the module prefix with the column name:

ModulePrefixExample
ApplicationsARAR:IsReady == true
User MigrationsURUR:Total > 0
DevicesDRDR:ReadyPercent > 75
MailboxesMRMR:OutOfScopeCount < 5
Bespoke ModuleBRBR:ReadyCount == 15
DefectsDYDY:IsReady == true
TasksTRTR:RemainingCount < 5

Readiness Metrics

  • IsReady: Boolean, true if all items in the module are ready.
  • Total: Number of linked items.
  • ReadyCount: Count of items marked ready.
  • RemainingCount: Items not yet ready.
  • ReadyPercent: Percentage of ready items.
  • OutOfScopeCount: Items excluded from readiness.

Partial Text Matching – Like

Rule NameRule TypeData LocationOperatorCriteria
DSKFieldHostnameLikeDSK*
TESFieldHostnameLikeTes*

Explanations

  • DSK: Matches hostnames starting with “DSK” (e.g. DSK001).
  • TES: Matches hostnames starting with “Tes” (e.g. TesServer).

Custom Logic: [TES] -or [DSK] — Passes if either rule is successful.

About the Like Operator

  • DSK* matches any value starting with “DSK”.
  • Tes* matches any value starting with “Tes”.

Logic Tips

  • Use -or to allow a match for any pattern.
  • Use -and to require all matched.
  • Parentheses ( ) group logic for order of evaluation.

Example: ([TES] -or [DSK]) — Passes if hostname matches TES or DSK.



Regex Plan Rule

Check an Email Address is Valid

Rule NameRule TypeData LocationOperatorCriteria
Email Address ValidFieldEmailMatch^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$

Explanation

  • Validates the Email field against a standard email address format.

Regex Explanation

  • ^ — Start of string
  • [a-zA-Z0-9._%+-]+ — Local part, valid characters before the @
  • @ — At symbol
  • [a-zA-Z0-9.-]+ — Domain part
  • \. — Dot before domain suffix
  • [a-zA-Z]{2,} — Suffix of at least two letters
  • $ — End of string

Examples that pass:

  • user@example.com
  • first.last@domain.co.uk
  • name123@sub.domain.net

Examples that fail:

  • user@domain (missing suffix)
  • @domain.com (missing local part)
  • user@.com (invalid domain)

Evaluate if a Text Field Has a Value of 16 or More

Rule NameRule TypeData LocationOperatorCriteria
16Gb or MoreFieldDV:MemoryMatch\b[1-9][6-9]\b

Explanation

  • Matches two-digit values from 16 to 99 (e.g. memory in GB).

Regex Explanation

  • \b — Word boundary
  • [1-9] — First digit (1–9, not 0)
  • [6-9] — Second digit (6–9)
  • \b — Word boundary

Examples that pass: 16, 32, 64, 99
Examples that fail: 15, 08, 100

Note: This pattern assumes values are stored as integers. Adjust the regex if units (e.g. GB) are included.



Using the [Blank] Keyword

Rule NameRule TypeData LocationOperatorCriteria
FieldFieldDeployUnit!=[Blank]

Explanation

  • Passes if the DeployUnit field contains any value.

Usage:

  • == [Blank]: Passes if the field is empty.
  • != [Blank]: Passes if the field is populated.

The [Blank] keyword identifies missing or unassigned data, useful for data quality and validation checks.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article