Connecting to JIRA (Atlassian) with KNIME Server

I am looking to connect a job on the Knime Server to JIRA to get data from JIRA issues and to create new issues.

So far all my attempts have not been successful. I first tried using the OAuth2 Authenticator in the platform (with no success) but then read that the node does not currently work from the Knime Server. I saw another post where someone was successfully connecting to JIRA via the Credential Configuration and Get Request nodes. Can someone who has done this successfully show the steps/images of the nodes. From the JIRA side, I already created an API token and an app.

image

Hi @mpodval and welcome to the forum. :slight_smile:

Tagging @armingrudd as he has… a fair amount of experience building workflows that talk to Jira. :smiley:

Hello @mpodval and welcome to the KNIME community forum,

You are already on the right track. Having your Jira API token, you can use your Jira email (username) and the API token (password) to authenticate.

In REST nodes, the second tab “Authentication” is wehre you can select “Basic” and then use your credentials to authenticate. Also, you can provide the credentials via a credentials variable e.g. from a “Credentials Configuraiton/Widget” node or the Secret Retriever node.

1 Like

Thank you @armingrudd. What is the format of the URL in the connection tab of the GET Request? I’ve tried a few different options and keep receiving Status 400.

Dear @mpodval,

As explained in the Jira REST API documentation, the base URL for APIv3 is:

https://<your-domain>.atlassian.net/rest/api/3/<resource-name>

For example, if you want to use JQL to search for issues, the request URL would be:

https://<your-domain>.atlassian.net/rest/api/3/search/jql

And then you put the JQL, fields, etc. in the body. Here you can find more details for this particular example.

2 Likes

(post deleted by author)

@armingrudd, I figured out the URL syntax to retrieve all issues using jql. For anyone else with similar concerns, I found it simple to use https://reqbin.com in order to construct the URL for the GET Request.

  • Start out with https://<your-domain>.atlassian.net/rest/api/3/search/jql
  • Then add params, for example the first key is jql and the first value is project = <your project>

Dear @mpodval,

Nice to hear you have figured it out. Just for you information, if your JQL is too large then you still need to use it in the body of a POST request.

An example JSON body:

{
  "jql" : "issuetype in (typeA, typeB, typeC) AND status in (Done, Closed) AND resolution in (Done) AND project in  (prject1, prject2) AND resolved >= \"2020-01-01\"",
  "startAt" : 0,
  "maxResults" : 0,
  "fields" : [ "fixVersions", "resolution", "status", "issuekey", "issuetype", "project", "resolutiondate", "summary" ],
  "fieldsByKeys" : false
}

Sending 0 as maxResults will return the total number of issues (based on the JQL) in the response. Then you can modify your request body to request all issues at once or get them in batches.

1 Like