Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Need help with enhanced query to populate arstasks comments with request_access comments value

savuser17
Regular Contributor
Regular Contributor

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:

savuser17_0-1716897285679.png

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

7 REPLIES 7

Raghu
All-Star
All-Star

@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


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

savuser17
Regular Contributor
Regular Contributor

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

rushikeshvartak
All-Star
All-Star

Because it contains html code it will not work to update. 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

So there is no way to make the usecase work? Is there any alternative code you can think of?

Add non html code


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

savuser17
Regular Contributor
Regular Contributor

May I know what is the html part of the code here? Do you have any sample code to refer from?

<span class


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.