Automation Script - Extracting 16-Digit Numbers with Specific Patterns
Set the escalation to read the script. The script takes input from the Long Description, finds the 16-digit numbers from that string with the mentioned pattern, and then sets those numbers to the Summary (in the SR application)
Step 1: Create script with action launch point having two variables (IN, OUT).
# Find 16 Digit numbers from Long
Description and Set all 16 Digit Numbers in Summary
from java.lang import Runtime
from java.util.regex import Matcher
from java.util.regex import Pattern
descript=''
longdesc1=''
# Find the patterns of 16 Digit numbers from String and Set that 16 digit numbers into summary
pp1 = Pattern.compile("((\d{4})-(\d{4})-(\d{4})-(\d{4}))|((\d{4}) (\d{4}) (\d{4}) (\d{4}))|(\\b\\d{16}\\b)" )
m1= pp1.matcher(longdesc)
while(m1.find()):
longdesc1=longdesc1+" "+m1.group()
descript=longdesc1
Step 2: Created Escalation <Escalation Name> with SEPARATE (Launch Point Name) action.
Comments
Post a Comment