Is there any more in depth guide on how to configure Jira project import?

I have a recent version of self hosted jira and self hosted Taiga I’m trying to migrate to.

I’m looking at taiga-docker/README.md at master · taigaio/taiga-docker · GitHub and Migrate from Jira to Taiga
The docker guide recommends configuring docker-compose.yml

ENABLE_JIRA_IMPORTER: "True"
JIRA_IMPORTER_CONSUMER_KEY: "consumer-key-from-jira"
JIRA_IMPORTER_CERT: "cert-from-jira"
JIRA_IMPORTER_PUB_CERT: "pub-cert-from-jira"

what are JIRA_IMPORTER_CONSUMER_KEY?JIRA_IMPORTER_CERT?JIRA_IMPORTER_PUB_CERT?

I tried grepping through the source code (config.py) but couldn’t find any clues

ENABLE_JIRA_IMPORTER = os.getenv('ENABLE_JIRA_IMPORTER', 'False') == 'True'
if ENABLE_JIRA_IMPORTER:
    IMPORTERS["jira"] = {
        "active": True,
        "consumer_key": os.getenv('JIRA_IMPORTER_CONSUMER_KEY'),
        "cert": os.getenv('JIRA_IMPORTER_CERT'),
        "pub_cert": os.getenv('JIRA_IMPORTER_PUB_CERT')
    }

was all I found and I couldn’t find where/how those variables were used.

Are they related to oauth client id/client secret in jiras Application link mentioned in the jira migration link above ?

Hi @RT-AP

These parameters are used to authenticate request to the Jira API (using OAuth1)

You can follow the source code, from the taiga API to the jira client:

As you can see, these are the parameters needed to connect to the self-hosted jira instance.
To generate for your jira instance, you can follow this steps:

Taiga: Importers

Regards

thanks @david.barragan
so consumer_key is oath1 consumer_key. But I can’t seem to find a lot about it googling for oauth1 and consumer_key. Is it just an arbitrary identifier for the client?
Also does the public/private key data need to be added to jira configuration somewhere in addition to being configured in taiga?

Yes, is an arbitrary identifier between taiga and jira instance.

This tutorial explains better the process (I hope) https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/ check especially step 2.

The public key should be configured in the Jira instance too with the consumer key when you create the “incomming link” (step 5 and 6 Migrate from Jira to Taiga).

  1. use your consumer key and your public key

Thanks

I did add
volumes:
- taiga-static-data:/taiga-back/static
- taiga-media-data:/taiga-back/media
- ./taiga-gateway-nginx-https-certs/jira-self-singed-cert-chain.apcon.cer:/usr/local/share/ca-certificates/jira-self-singed-cert-chain.apcon.cer

to taiga-back/taiga/async to fix the ssl issues since jira uses a self signed cert but then it successfully added and showed me the projects to import and the users to map.

Now the only problem is it tells me it might take a while to import the Project and never does import it. Any ideas what might be wrong?

The import is an asynchronous task. Try to review the logs of the celery worker (taiga-async service) that is responsible for performing these tasks.

docker compose logs taiga-async 

or the backend

docker compose logs taiga-back 

And remember this:

Important notice about Jira releases and Taiga compatibility

  • Taiga support Jira releases up to 8.3.5. It has been tested and should work out of the box.
  • Taiga might support Jira releases from 8.3.5 to 8.5.x. Most probably it works.
  • Taiga does not support Jira releases from 8.6.

Its jira version 8.02

"-"
taiga-docker-taiga-async-1            | [2023-03-15 08:52:34,275: ERROR/MainProcess] Received unregistered task of type 'taiga.importers.jira.tasks.import_project'.
taiga-docker-taiga-async-1            | The message has been ignored and discarded.
taiga-docker-taiga-async-1            |
taiga-docker-taiga-async-1            | Did you remember to import the module containing this task?
taiga-docker-taiga-async-1            | Or maybe you're using relative imports?
taiga-docker-taiga-async-1            |
taiga-docker-taiga-async-1            | Please see
taiga-docker-taiga-async-1            | http://docs.celeryq.org/en/latest/internals/protocol.html
taiga-docker-taiga-async-1            | for more information.
taiga-docker-taiga-async-1            |
taiga-docker-taiga-async-1            | The full contents of the message body was:
taiga-docker-taiga-async-1            | b'\x80\x04\x95"...\x18https://jira.apcon.cloud\x94}\x94(\x8c\x0caccess_token\x94...\x94\x8c\x13access_token_secret\x94...\x94\x8c\x08key_cert\x94X\...\x00-----BEGIN PRIVATE... (3373b)
taiga-docker-taiga-async-1            | Traceback (most recent call last):
taiga-docker-taiga-async-1            |   File "/opt/venv/lib/python3.7/site-packages/celery/worker/consumer/consumer.py", line 581, in on_task_received
taiga-docker-taiga-async-1            |     strategy = strategies[type_]
taiga-docker-taiga-async-1            | KeyError: 'taiga.importers.jira.tasks.import_project'

This is the error:

taiga-docker-taiga-async-1            | [2023-03-15 08:52:34,275: ERROR/MainProcess] Received unregistered task of type 'taiga.importers.jira.tasks.import_project'.

This is because the jira importer module is not configure properly. It seems that it is only enabled on the taiga-front service but not on the other taiga-back and taiga-async services.

Edit your docker-compose.yml and set this

version: "3.5"

x-environment:
  &default-back-environment
  #  
  # (...)
  #
  # Jira importer
  ENABLE_JIRA_IMPORTER: "True"
  JIRA_IMPORTER_CONSUMER_KEY: "paste_your_consumer-key_here"
  JIRA_IMPORTER_CERT: "paste_the_content_of_your_private_key_file_here"
  JIRA_IMPORTER_PUB_CERT: "paste_the_content_of_your_public_key_file_here"
#
# (...)
#
services:
  #
  # (...)
  #
  taiga-front:
    image: taigaio/taiga-front:latest
    environment:
      #
      # (...)
      #
      ENABLE_JIRA_IMPORTER: "true"
    networks:
      - taiga
#
# (...)
#

So now, when you initialize the instance and check the taiga-async logs, you should see the task that is responsible for processing the Jira imports loaded (likd in the image below).

If you’ve made it this far, try importing the project again.

thanks that fixed it.
I got the sample project imported.

I only had it configured for taiga-back not the shared default-back-environment.
GitHub - kaleidos-ventures/taiga-docker should probably update their README since they suggest it only on taiga-back

Great!!! :tada:

You are absolutely right, the configuration guide is somewhat confusing about where to configure the plugins and importers. We’ll change it to be clearer.

Thanks.

2 Likes

While it seems to work with stories/links/etc

sadly instead of comments its gives

Development: {summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@746654b1[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@5e52f67f[overall=PullRequestOverallBean{stateCount=0, state=‘OPEN’, details=PullRequestOverallDetails{openCount=0, mergedCount=0, declinedCount=0}},byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@465cf35b[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@f7414e1[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@2be24d5a[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@6495748f[stateCount=0,state=,dueDate=,overDue=false,count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@45f2856d[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@6a0e422e[topEnvironments=,showProjects=false,successfulCount=0,count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@53bf5aa8[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@1cc16d5c[count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@4dc95a44[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@55ce6ee1[count=0,lastUpdated=,lastUpdatedTimestamp=],byInstanceType={}]},errors=,configErrors=], devSummaryJson={“cachedValue”:{“errors”:,“configErrors”:,“summary”:{“pullrequest”:{“overall”:{“count”:0,“lastUpdated”:null,“stateCount”:0,“state”:“OPEN”,“details”:{“openCount”:0,“mergedCount”:0,“declinedCount”:0,“total”:0},“open”:true},“byInstanceType”:{}},“build”:{“overall”:{“count”:0,“lastUpdated”:null,“failedBuildCount”:0,“successfulBuildCount”:0,“unknownBuildCount”:0},“byInstanceType”:{}},“review”:{“overall”:{“count”:0,“lastUpdated”:null,“stateCount”:0,“state”:null,“dueDate”:null,“overDue”:false,“completed”:false},“byInstanceType”:{}},“deployment-environment”:{“overall”:{“count”:0,“lastUpdated”:null,“topEnvironments”:,“showProjects”:false,“successfulCount”:0},“byInstanceType”:{}},“repository”:{“overall”:{“count”:0,“lastUpdated”:null},“byInstanceType”:{}},“branch”:{“overall”:{“count”:0,“lastUpdated”:null},“byInstanceType”:{}}}},“isStale”:false}}

Any ideas on how to fix it?

O_o

No Idea, It’s the first time I see this error :frowning: Maybe you could disable some plugin in Jira, although I don’t know if that could be the cause.

I think it might be caused by [JSWSERVER-16544] Development Field is REST API / webhook doesn't return result in the correct format - Create and track feature requests for Atlassian products.
but sadly that doesnt list solutions/workarounds

Also it seems to show each project twice for the jira Project and the jira Board, I’m guessing its better import the Project not the board?
Sorry I haven’t used jira much, do the projects have more stuff besides the board?

I haven’t used Jira much either (for an obvious reason xD). Checking the importer code in Taiga I see that users, epics, user stories, task and issues are imported. There are two types, normal (for project) and agile (for boards). Try both, it’s probable that “project” give less errors.

1 Like

For some reason Board seems to do better for me. It gets more stuff sorted in sprints. And I dont see anything missing

What does the “Links with Do you want to keep the link of each item with the original card?” do?

It’s to maintain a link to the item in Jira.

actually I was wrong looks like project import is better.