I know that there is a feature in Assyst 11.6 to add additional affected user but we are running 11.4.3 version which does not support this feature. We have a use case where end user will be creating a request in AssystNet and will input a additional affected user in a custom lookup field and we need to add that user as a additional affected user using custom script. Did anyone achieve this using custom script using restAPI or through ETM. Would appreciate help on this.
Hi Danesho,
I believe this would be possible by using the Action Processor and the ETM tool.
You would need a SQL file to obtain the custom fields used within your offering within assystNET, for example:
sql(l(SELECT wcpc.string_value "USER_EMAIL"
FROM jptsys_web_cust_prop AS wcp
INNER JOIN jptsys_web_cust_prop_cont AS wcpc
ON wcp.jptsys_web_cust_prop_id = wcpc.jptsys_web_cust_prop_id
WHERE wcp.jptsys_web_cust_prop_sc = 'USER EMAIL' AND wcpc.entity_id = ]] .. EVENT_ID)
You’ll also need to create a source file within your .conf file. You can do this by including the below:
{
name = "Create Source File for additional affected users" ]],
data_generation = d { "..\\sql\\Additional_Affected_User.sql" } ]],
condition = true ]],
activities = {
{"log",
"Additional_Affected_User.sql SQL completed successfully"]]
},
{ "script",
IMP_FILE_NAME = "F:\\Axios\\Test\\Automations\\RequestRemoteUpload\\AdditionalAffectedUser\\AdditionalAffectedUser_"..EVENT_ID..".csv"
LOGGER:info("The Impport file name is " .. IMP_FILE_NAME)
-- open the txt file for writing in windows binary format
f_handler,err = io.open(IMP_FILE_NAME,"wb")
-- open the file for output (writing)
io.output(f_handler)
-- do some error trapping
if not(f_handler) then
LOGGER:error("io.open returned error: " .. err)
os.exit(2)
return
else
LOGGER:info("Opened " .. IMP_FILE_NAME.. " OK")
end
io.write(string.format("%s,%s,%s\n", "eventID", "ShortCode", "AdditionalUser”)) -- Column headers
io.write(string.format("%s,%s,%s\n", EVENT_ID, AFF_USR_SC, USER_EMAIL)) -- Data row
io.close(f_handler)
BAT_FILE = "F:\\Axios\\Test\\Automations\\RequestRemoteUpload\\AdditionalAffectedUser.bat"
HEADER = "cd F:\\Axios\\Test\\Automations\\RequestRemoteUpload\r\n"
HEADER = HEADER.."PowerShell -NoProfile -ExecutionPolicy Bypass -Command "
HEADER = HEADER.."\"F:\\Axios\\Test\\Automations\\RequestRemoteUpload\\importtool.ps1\" -url YOUR_ENVIRONMENT_URL/assystETM/REST/ -username assystETM_USERNAME "
HEADER = HEADER.."-password PASSWORD_HERE "
HEADER = HEADER.."-channel \"ETM_CHANNEL_NAME\" -filename \"" ..IMP_FILE_NAME.."\""
HEADER = HEADER.."\r\n"
LOGGER:info(HEADER)
-- open the txt file for writing in windows binary format
f_handler,err = io.open(BAT_FILE,"wb")
-- open the file for output (writing)
io.output(f_handler)
-- do some error trapping
if not(f_handler) then
LOGGER:error("io.open returned error: " .. err)
os.exit(2)
return
else
LOGGER:info("Opened " .. BAT_FILE.. " OK")
end
io.write(string.format("%s",HEADER))
io.close(f_handler)
os.execute(BAT_FILE)
]]
},
},
"continue",
},
For your .bat file:
cd F:\Axios\Test\Automations\RequestRemoteUpload
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "F:\Axios\Test\Automations\RequestRemoteUpload\importtool.ps1" -url YOUR_ENVIRONMENT_URL/assystETM/REST/ -username ETM_USERNAME -password ETM_PASSWORD -channel "ETM_CHANNEL_NAME" -filename "F:\Axios\Test\Automations\AdditionalAffectedUser\AdditionalAffectedUser_5255103.csv"
You can then configure your ETM data mapper to put the value ‘inbound.AdditionalUser’ as a custom contact user.
I have not tested this method but feel that this would work - this does assume that you already have the ‘importtool.ps1’ PowerShell script within your environment.
Hi
Below is a screenshot from the Datamapper which I configured to update event and billing_approvar is the variable that has the additional affected users object, but i am not able to assign this object to Additional Affected user Field as it says ‘Search not supported by assyst, an expression must be used’ to update the event which i am assuming that ETM does not support update of additional affected user field for an event.
Hi,
Can you try the below instead of the ‘Additional Affected User’ field? I cannot see the extended details of your ‘billing_approver’ variable but you will need some way to extract some kind of value from the variable (Name, ID, Short Code, etc.)
It’s also worth running an import to see if it works as it appears when I debug, it doesn’t show a value but the additional user is added to the ticket as expected.
Is your assyst resource set to ‘Event’ at the top of the mapper?
Yes it is set to Event, but its strange that we dont have this feature and our version is upgraded then yours. Seems like i need to create a support request with IFS.
Hi
When using the below in my environment, I can still assign an additional affected user within the ticket even though it suggests an expression must be used.
In my case, I am getting the imported users managerId and then using that as the additional affected user but in your case, you need to try and extract the ID of the user entered in your custom field.
Thanks
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.