JIRA SDIM integration with Sailpoint

We have a requirement to raise a ticket to Jira Service Desk from SailPoint whenever access is revoked for certain applications.

For a single source, the ticket is getting generated correctly.

{
  "summary": "Summary",
  "issuetype": {
    "name": "Story"
  },
  "description": "Sample",
  "project": {
    "key": "ABC"
  }
}

However, when trying with multiple sources, the condition checks are being bypassed, and the ticket is raised using the else condition (i.e., assigned to project ABC).

It seems like the source name comparison is failing in the template.

Let me know if anyone has faced a similar issue or can suggest a workaround.

{
  "summary": "Summary",
  "issuetype": {
    "name": "Story"
  },
  "description": "Sample",
  "project": {
    "key": "#if ($plan.requests.get.resource == 'Source1')ABC#{elseif ($plan.requests.get.resource == 'Source2')}DEF#{else}ABC#{end}"
  }
}

does all the sources involved in the ticket generation process are properly configured and connected to ISC? assuming you have workflow, once review workflow as well again.

Hi @shikhadeliveroo,

Can you try below and see if it works:

{
  "summary": "Summary",
  "issuetype": {
    "name": "Story"
  },
  "description": "Sample",
  "project": {
    "key": "#foreach ($request in $plan.requests) #if ($request.getSource().getName() == 'Source1')ABC#{elseif ($request.getSource().getName() == 'Source2')}DEF#{else}ABC#{end} #end"
  }
}

Thanks @nithyamn13 but this is not working. it is throwing 400 error. I guess it is not able to find and compare the source name.

I hope this should work. can you try below:

{
  "summary": "Summary",
  "issuetype": {
    "name": "Story"
  },
  "description": "Sample",
  "project": {
    "key": "#set($projectKey = 'ABC') #foreach ($request in $plan.requests) #if ($request.getSourceName() == 'Source1') #set($projectKey = 'ABC') #break #{elseif ($request.getSourceName() == 'Source2')} #set($projectKey = 'DEF') #break #{else} #set($projectKey = 'ABC') #end #end $projectKey"
  }
}

Still getting 400 error.

Failed: Failed and will not be retried

Errors

sailpoint.connector.InvalidRequestException: [ InvalidRequestException ] [ Error details ] Invalid request received to IT Service Desk System. Status: 400, Output: {"errorMessages":[],"errors":{"project":"valid project is required"}}