Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/28/2024 05:00 AM
Hello,
Due to an issue with printing the separate entitlements business justifications in Service Now ticket, we have come up with a workaround to populate the arstasks Comments field with the comments field of request_access Comments field.
The query we have to print the business justification shows like this in data analyser:
However, when we run this in enhanced query, even though it shows both business justifications, it only prints one. So we are trying to find a way to concatenate two rows so that we can print both at once.
So far, tried Group_Concat ( which times out), and String_Agg (which is not allowed to run). Does ay one have any ideas?
This is the enhanced query -
select ra.COMMENTS as arstasks__COMMENTS, ar.taskkey as arstasks__primarykey from arstasks ar, request_access ra where ar.REQUESTKEY = ra.REQUESTKEY and ar.REQUESTKEY = 8536 and ar.tasktype in ('3')
Thanks in advance
05/28/2024 05:47 AM - edited 05/28/2024 05:50 AM
@savuser17 try below working fine my end , add your requestkey condition and try it
Sample :
SELECT
GROUP_CONCAT(ra.COMMENTS SEPARATOR ' ') AS arstasks__COMMENTS,
ar.taskkey AS arstasks__primarykey
FROM
arstasks ar
JOIN
request_access ra ON ar.REQUESTKEY = ra.REQUESTKEY
WHERE
ar.TASKKEY IN ('622205')
GROUP BY
ar.taskkey
your query:
SELECT
GROUP_CONCAT(ra.COMMENTS SEPARATOR ' ') AS arstasks__COMMENTS,
ar.taskkey AS arstasks__primarykey
FROM
arstasks ar
JOIN
request_access ra ON ar.REQUESTKEY = ra.REQUESTKEY
WHERE
ar.REQUESTKEY = 8536 and ar.tasktype in ('3')
GROUP BY
ar.taskkey
05/28/2024 06:15 AM
Hi Raghu,
Thank you for the code - but I tried it and it timed out in data analyser and does the same when I try to save it in the enhanced query too.
May I know what version of Saviynt you are using? And if you have an alternate code?
Thank you
05/28/2024 06:33 AM
Because it contains html code it will not work to update.
05/28/2024 06:55 AM
So there is no way to make the usecase work? Is there any alternative code you can think of?
05/28/2024 06:55 AM
Add non html code
05/30/2024 03:10 AM
May I know what is the html part of the code here? Do you have any sample code to refer from?
05/30/2024 06:15 AM
<span class