Connecting to JIRA via Custom REST API
Jira provides a framework to pull data from via a REST API.
In this forum post we will show how to create a Custom REST Connector to pull information from Jira to the Sisense Elasticube using basic header authentication. You can find information about the Jira REST API here:
This connector is applicable to Sisense 6.5.2 and up.
We are going to use the endpoint "/rest/api/2/search" that you can find more information about here:
1. Download the connector files from this location.
.
2. Copy the folder REST.Jira.Connector containing both, the config.json and Sisense.Connectors.RestConnector.dll files to the following location where Sisense is installed:
%Program Files%\Sisense\DataConnectors\DotNetContainer\Connectors
3. Create a token in 64base according to you user credentials in the following format:
username:password You can use any online service encoder to set the base to 64. I've used https://www.base64encode.org/
4. In the config.json file, add to the parameter Base the url of your Jira server
5. In the config.json file, add to the parameter Path the path for the search query. In this case keep "/rest/api/2/search"
6. In the config.json file, add to the section QueryParameters the criteria of your search. In the example of the documentation in Jira, we are looking for all issues assigned to fred. You can set any criteria that you want.
7. Choose the fields that you want to pull from each issue. (In our example we are bringing only id and description.)
8. Make sure to add the same QueryParameters in the PagingConfig section of the config file.
9. Restart the services Sisense.CLRConnectorsContainer and ElasticubeManagementService.
10. In the Elasticube Manager, click on "Add Data" and you should see "Jira" under the Web Services section of the menu.
-
This connector works great.
Is it possible to configure it to pull down the field names into a second table? At the moment issues can contain custom fields which have ids such as "customfield_12606". The title of these fields is available under the /rest/api/2/field endpoint but this does not require any query parameters or paging.
If we could pull those into Sisense then we could re-map their names in the Elasticube to their human-readable names.
-
Hi,
I'm having the same issue as David Resowski. I copy the folder from within the .zip file to the Connectors folder, and then it disappears. I tried copying it to another location, and then moving to the Connectors folder. This seemed to work at first, but then after restarting the services, the folder disappeared. My ElastiCube Manager build is 6.7.0.12010. Is the version not compatible?
-
Hey,
Please try to update config.json as per instruction with relevant information at first and then copy to connectors folder. When connector service see incorrect config.json, folder is moved to the Ignored folder.: C:\Program Files\Sisense\DataConnectors\DotNetContainer\Ignored
Oleg
-
The folder is likely being deleted due to a mismatch in the Sisense version you're running vs. what the Sisense version the .dll within the custom connector is on.
If you are noticing the folder getting wiped out of the Connectors folder, please do the following:
- Take a copy of your custom connector and place it outside of the the Sisense folders (say on your desktop)
- Remove the .dll file (this will be re-created later on in the process)
- Move your custom REST connector folder and place it in this folder: C:\Program Files\Sisense\DataConnectors\DotNetContainer\Connectors
- Open the Services program and restart the Sisense.CLRConnectorsContainer service
- The .dll file should be regenerated within the custom connector folder
-
Using this in 2019 and running into an issue ... or two! Any help is appreciated. I really would like to get this working.
We have Jira cloud installation. Trying to get the REST connector set up with our on-prem Sisense installation.
So I followed the instructions above - downloaded the connector, made the edits to the json file, restarted the services, but the restconnector.dll file wasn't generated in the folder. So I copied the generic dll file (as per Sisense documentation) from
C:\Program Files\Sisense\DataConnectors\DotNetContainer\RestSamples\REST.LinkedIn.Connector
into my Jira rest connector folder. I still don't see Jira showing up in the elasticube manager.
Attaching my json file for reference.
BTW, I know the token, base, path and jql (in the json file) are correct because I'm getting the required response in Postman
What am I missing?
Also, how is everyone using Jira to analyze projects, issues etc in Sisense?
Thanks. A. Lot.
-
So, the Jira connector showed up in my elasticube manager. I'm not sure what I did differently, but I restarted services and I see the connector under web services. But it seems like it isn't connecting to my Jira instance. I get the following error '[odbc driver manager] data source name not found and no default driver specified'
And this leads to an empty table view as shown below. Sisense documentation on troubleshooting this says -
https://developer.sisense.com/display/API2/Troubleshooting+Custom+REST+Connectors
to set the key DataPath to 'results' to hold the data if its returned as an array instead of json. I edited my config file to reflect this, but no change. Its possible I didn't get the fields configured right. All I did was to point DataPath to results and changed nothing else.
Again, appreciate any help from people using this connector. Thanks!
-
Hi, you need mongodb odbc driver installed. Not sure why but that resolved it for me. https://documentation.sisense.com/latest/managing-data/connectors/mongo-db.htm
-
Hi,
Has anyone seen an issue where the Sisense REST Jira Connector only returns the first 50 JIRA issue results and the next pages of results don’t load?
Here’s my config.json (with token and base removed).
{
"Settings": {
"Provider": "rest.jira.connector",
"DisplayName": "Jira",
"MaxDocs": 100,
"FetchSize": 1000000,
"Parameters": {
"BasicToken": "<<removed>>"
}
},
"Tables": [
{
"Name": "Issues",
"Schema": "Https",
"Public": "True",
"Method": "GET",
"Base": "https://<<removed>>",
"Path": "/rest/api/2/search",
"Headers": {
"Authorization": "Basic [@Settings.Parameters.BasicToken]"
},
"DataPath": "issues",
"PathParameters": [],
"QueryParameters": {
"jql": "updatedDate > startOfYear()",
"fields": "",
"startAt": 0
},
"PagingConfig": {
"Type": "URL",
"KeepUrl": "true",
"NextPage": "${[@Tables.Issues.@.startAt] + 50}",
"QueryParameters": {
"jql": "updatedDate > startOfYear()",
"fields": "",
"startAt": "[@nextpage]"
}
},
"Body": {},
"DataFormat": "Json"
}
]
}
In the /ProgramData/Sisense/DataConnectors/DotNetContainer/Logs/root.log log I see the error “GetNext: request config didn't pass validation”
2019-07-09 10:50:09,415 [6] [NT AUTHORITY\SYSTEM] DEBUG
Sisense.Connectors.RestConnector.RestExecutionContext - Got parameter [@Tables.Issues.@.startAt] value: 0 .
2019-07-09 10:50:09,418 [6] [NT AUTHORITY\SYSTEM] DEBUG RestRequestHandler - GetNext: nextPage=50, proceed= true
2019-07-09 10:50:09,419 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Getting parameter [@Settings.Parameters.BasicToken] value.
2019-07-09 10:50:09,421 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Got parameter [@Settings.Parameters.BasicToken] value: ZGF2aWQuaGF5dGVyOk1vamVXaWxsMTAh .
2019-07-09 10:50:09,422 [6] [NT AUTHORITY\SYSTEM] DEBUG
Sisense.Connectors.RestConnector.RestExecutionContext - Getting parameter [@nextpage] value.
2019-07-09 10:50:09,424 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Getting in memory parameter nextpage value.
2019-07-09 10:50:09,425 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Getting parameter [@Tables.Issues.@.startAt] value.
2019-07-09 10:50:09,426 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Getting executable parameter [@Tables.Issues.@.startAt] value.
2019-07-09 10:50:09,428 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Getting executable parameter [@Tables.Issues.@.startAt] value. Got document from a cache .
2019-07-09 10:50:09,438 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Got parameter [@Tables.Issues.@.startAt] value: 0 .
2019-07-09 10:50:09,441 [6] [NT AUTHORITY\SYSTEM] DEBUG Sisense.Connectors.RestConnector.RestExecutionContext - Got parameter [@nextpage] value: 50 .
2019-07-09 10:50:09,442 [6] [NT AUTHORITY\SYSTEM] DEBUG RestRequestHandler - GetNext: request config didn't pass validation.
2019-07-09 10:50:09,502 [126] [NT AUTHORITY\SYSTEM] DEBUG RestRequestHandler - ExecuteActionAsync: Tables.Issues, records = 50, proceed= False
Am I specifying something wrong in my config.json?
Thanks
David
Please sign in to leave a comment.
Comments
17 comments