Need to pull a report of all future request for sunset

Which IIQ version are you inquiring about?

8.3

Please share any images or screenshots, if relevant.

Please share any other relevant files that may be required (for example, logs).

I need to pull a report of all the Workflow Request located under Objects>Request. I do not find anything under Advanced Analytics, but I could be missing something. Is there already a report or could I be missing something in Advanced Analytics? please see the screenshot for further information. it for users who will be sunset in the future.

You an use QueryOptions and context.search in order to generate the custom report you need.
Remembering that the report is a type of Task that runs certain querys.
That would be the best way to achieve what you want

best!

Hi Ivan,

Could you please walk me through that? Is this something in Advanced Analytics?

Nope, you need to create a Custom Report for it.
You need to define which columns you want for the report, adn create it based on that.

Never done that before. Are there any reports already made that do pull from what’s in the debug page that I can use to assist for the objects.request page?

if there is anyone who can write an OOTB report for what’s under the request object bowser, please let me know or point me in the right direction of how to get started. I am not good at coding at that level yet.

Hi @derrickthomasvdot,

You can use a query filter on the Request object to retrieve the necessary details. I have implemented the logic to extract these details from the request object and send them via email as a CSV file. Feel free to modify it according to your needs.

  import sailpoint.api.SailPointContext;
  import sailpoint.object.*;
 
  
  try{

 QueryOptions qp = new QueryOptions();
 qp.addFilter(Filter.like("name", "VDOT Leaver Sunset",Filter.MatchMode.START));
 qp.addFilter(Filter.eq("definition.name","Workflow Request"));
  ArrayList colsToRead = new ArrayList(); 
  colsToRead.add("id");
  colsToRead.add("name");
  colsToRead.add("created");
  colsToRead.add("nextLaunch");
  colsToRead.add("completed");

  List resultList = new ArrayList();
  resultList.add("id,name,created,nextLaunch,completed");
  Iterator req = context.search(Request.class,qp,colsToRead);
  while(req != null && req.hasNext()){
    
    Object [] record=req.next();
    
    resultList.add("\n"+record[0]+","+record[1]+","+record[2]+","+record[3]+","+record[4]);
 
  } 
   String data=resultList.toString().replace("[","").replace("]","");
   String toAddresses="[email protected]";
   EmailOptions options = new EmailOptions(toAddresses, null);      
      byte[] postData = data.getBytes();
      EmailFileAttachment fileAttachment=new EmailFileAttachment("Test.csv", EmailFileAttachment.MimeType.MIME_CSV,postData);
      options.addAttachment(fileAttachment);   
      EmailTemplate et = context.getObjectByName(EmailTemplate.class, "TemplateName");
      context.sendEmailNotification(et, options);
    return "csv file created and sent";

  }catch(Exception e){
   log.error("Exception: "+e); 
  }


Replace the TemplateName with your required Template. Please let me know if it works for you.

Regards,
Arun

Do I copy, paste and import this into SailPoint by way of global settings>import>import from file?

Hi @derrickthomasvdot,

Before that change the TemplateName, toAddresses([email protected]) and csv file name(test.csv).
import the attached rule and check.
Request_details.java (1.6 KB)

I imported and tried to run the rule but received a blank page for the rule results. I have attached the rule that I edited. Please let me know what needs to be corrected.

Rule is attached.

Request Workflow Test Rule.xml (1.7 KB)

Are you getting any emails?
Could you please check the log and share if it is any error?

I’m not getting any emails. I will check the logs

here is the error I am getting in the log:

2024-08-20T09:51:18,442 ERROR http-nio-8080-exec-10 sailpoint.server.InternalContext:166 - Exception: java.lang.NullPointerException

I need to figure out the output first as to why there is nothing there

  EmailTemplate et = context.getObjectByName(EmailTemplate.class, "WorkflowRequests");

“WorkflowRequests” is a valid Email template? if it is not valid, you will get Null point exception

If that is the case, then where would I find the proper name for the EmailTemplate? I’m a bit confused.

I see several or am I supposed to create a brand new one?

For testing, you can use the existing template. you can find the email template in debug page

Post Testing, you can create a new template as per your requirement.

Is there also away to make this as a report under Reports Quicklink as well?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.