Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0] [MIG] connector_jira: Migrate to version 15.0 #76

Merged
merged 62 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
45132a2
Add first brick of the connector_jira addon
guewen Nov 15, 2016
a19862c
Update ir.model.access.csv
damdam-s Jan 10, 2017
6f55474
Set uninstallable
guewen Apr 19, 2017
a584749
C2C-152 Add project.task.jira_issue_url
simahawk Nov 20, 2018
becc42f
add epic and issuetype to analytic line
Dec 13, 2018
3fe15ba
Test jira_key only if connector_no_export is True (#13)
Tonow-c2c Jan 4, 2019
1a64e2f
Better handling of users sync
simahawk Nov 27, 2018
1cf17c2
Replace text_field by options
guewen Jan 30, 2019
ec527ad
Add connector_jira_servicedesk
p-tombez Jan 29, 2019
6ee614b
Read access tokens with sudo
guewen Feb 1, 2019
a302517
Apply suggestions from code review
TDu Apr 8, 2019
5177074
Prevent error when linking users
guewen Apr 8, 2019
865905b
Apply suggestions from code review
TDu Apr 10, 2019
c77bf92
Fix oldname field
guewen Apr 10, 2019
542b715
Fix psycopg2.ProgrammingError: syntax error when no updated_worklogs …
grindtildeath Apr 25, 2019
f9cb1d2
Make migration more robust
guewen Apr 8, 2019
c72feeb
Use fallback project when task or project is inactive
jcoux May 22, 2019
29f57bc
Add base test class for worklog
simahawk May 8, 2019
c17045c
Allow several bindings on projects
guewen Jun 25, 2019
6495347
[ADD] icon.png
OCA-git-bot Jul 12, 2019
42ace8d
[MIG] connector_jira: Migration to 12.0
alexey-pelykh Jul 20, 2019
e5b379c
[IMP] connector_jira: improved user binding
alexey-pelykh Aug 11, 2019
8168a5c
connector_jira 12.0.1.0.1
OCA-git-bot Aug 20, 2019
1d09fa7
[IMP] connector_jira: do not track sync updates
alexey-pelykh Aug 11, 2019
4bad301
connector_jira 12.0.1.0.2
OCA-git-bot Aug 20, 2019
65e69fd
[IMP] connector_jira: view JIRA keys on project and task views
alexey-pelykh Aug 11, 2019
3724a03
connector_jira 12.0.1.1.0
OCA-git-bot Aug 23, 2019
d189965
[IMP] connector_jira: restrict linked tasks alteration
alexey-pelykh Aug 11, 2019
ad51677
[IMP] connector_jira: search by jira keys
alexey-pelykh Aug 24, 2019
cdbe5cd
connector_jira 12.0.1.2.0
OCA-git-bot Sep 2, 2019
07b98f4
[IMP] connector_jira: import estimation and status for tasks
alexey-pelykh Aug 23, 2019
7efced5
[IMP] connector_jira: restrict linked AAL modification
alexey-pelykh Sep 1, 2019
1acfa6b
[FIX] connector_jira: issues can be moved between projects
alexey-pelykh Nov 7, 2019
30acc91
[IMP] connector_jira: worklog/timesheet date timezone
alexey-pelykh Nov 8, 2019
bfc576b
[FIX] connector_jira: UI layout
alexey-pelykh Nov 21, 2019
f895f69
connector_jira 12.0.1.4.0
OCA-git-bot Dec 3, 2019
022b403
[IMP] connector_jira: write only updated values, validate by cache fo…
alexey-pelykh Dec 4, 2019
3e8c939
connector_jira 12.0.1.5.0
OCA-git-bot Dec 5, 2019
a9a87e1
[IMP] connector_jira: forced import option
alexey-pelykh Nov 20, 2019
324d4d9
connector_jira 12.0.1.6.0
OCA-git-bot Dec 5, 2019
2ba4f73
[IMP] connector_jira: consider archived employees
alexey-pelykh Feb 13, 2020
c189aee
connector_jira 12.0.1.6.1
OCA-git-bot Feb 14, 2020
4222e23
[FIX][11.0] Remove enterprise related code
jcoux Feb 26, 2020
6d25c24
connector_jira 12.0.1.6.2
OCA-git-bot Feb 27, 2020
b599b00
[13.0][MIG] connetor_jira: migration
Apr 25, 2020
49d2a0c
[REM] pot file
May 7, 2020
fc394d2
[IMP] apply black, isort
May 8, 2020
6cdcd0a
connector_jira: Fix _compute_jira_issue_url dependencies
grindtildeath Aug 5, 2020
521619a
connector_jira: Fix inconsistent 'compute_sudo' for computed fields
grindtildeath Aug 5, 2020
6679b5e
connector_jira: Fix parameter 'oldname' is not longer supported; use …
grindtildeath Aug 5, 2020
8f8b472
connector_jira: Fix view inheritance of project.link.jira
grindtildeath Aug 5, 2020
72a8bee
connector_jira: Fix display of button in footer on project create form
grindtildeath Aug 5, 2020
41b88cc
[FIX] remove use of deprecated method
gurneyalex Aug 24, 2020
0c1e5ed
connector_jira: Add epic link on epic
grindtildeath Jul 31, 2020
e6110e3
Pre-commit fixes
leemannd Jan 20, 2021
987cd78
prettier
leemannd Jan 20, 2021
347f9ac
Fix missing assignement in compute function
leemannd Mar 8, 2021
7f6923f
connector_jira 13.0.1.0.1
OCA-git-bot Mar 11, 2021
1a55ac3
[FIX] set company_id on the task related to the project
vrenaville Apr 30, 2021
fd17e0f
connector_jira 13.0.1.1.0
OCA-git-bot Jun 15, 2021
02e9451
[IMP] connector_jira: black, isort, prettier
sonhd91 Jun 1, 2022
6ca7841
[15.0][MIG] connector_jira: Migrate to version 15.0
sonhd91 Jun 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
254 changes: 254 additions & 0 deletions connector_jira/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
==============
JIRA Connector
==============

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fconnector--jira-lightgray.png?logo=github
:target: https://github.com/OCA/connector-jira/tree/15.0/connector_jira
:alt: OCA/connector-jira
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/connector-jira-15-0/connector-jira-15-0-connector_jira
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/233/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds Jira synchronization feature.

**Table of contents**

.. contents::
:local:

Installation
============

You need the following Python packages:

* requests
* jira
* oauthlib
* requests-oauthlib
* requests-toolbelt
* PyJWT
* cryptography

Once the addon is installed, follow these steps:

Job Queue
~~~~~~~~~

In ``odoo.conf``, configure similarly:

.. code-block::

[queue_job]
channels = root:1,root.connector_jira.import:2


Backend
~~~~~~~

1. Open the menu Connectors > Jira > Backends
2. Create a new Jira Backend

* Put the name you want
* Set the URL of your Jira, like https://jira.example.com
* You can also select the company where records will be created and the
default project template used when Odoo will create the projects in Jira

3. Save and continue with the Authentication

Authentication of Backend
~~~~~~~~~~~~~~~~~~~~~~~~~

1. On the created backend, click on the Authenticate button, a popup with keys
will appear, keep these open in a tab
2. Open Jira and go to System > Applications > Application links
3. Enter the name of the application, example: odoo, and click on "Create new link"
4. In the popup, set the URL where JIRA can reach Odoo. Jira might complain and
reopen the popup, confirm it again and a new popup appears
5. In the new popup, do not set anything in the fields and click on Continue
6. The link should be created now, edit it with the pen on the right
7. Open the Incoming Authentication panel, be warned that it may take some time
to load
8. Copy-paste the consumer key and public key from Odoo to the Jira link's
Incoming Authentication. Set a consumer name (e.g. odoo) and leave the
consumer callback url and 2 legged auth blank.
9. Click on save at the bottom of the form (you need to scroll)
10. Back on Odoo, click on Continue
11. A link is displayed, click on it - you may need to login again - and click
on "Allow".
12. Back on Odoo again, click on Continue
13. Authentication is complete!


Configuration of the Backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Setup the webhooks**

It is advised to setup the webhooks so the synchronizations are in realtime.

1. On the Jira Backend, set the "Base Odoo URL for Webhooks" to URL of Odoo,
it must be reachable from Jira.
2. Click on "Install Webhooks"

**Configure the Epic Link**

If you use Epics, you need to click on "Configure Epic Link", Odoo will search
the name of the custom field used for the Epic Link.

**Configuration done**

You can now click on the button "Configuration Done".

Usage
=====

The tasks and worklogs are always imported from JIRA to Odoo, there
is no synchronization in the other direction.

Initial synchronizations
~~~~~~~~~~~~~~~~~~~~~~~~

You can already select the "Imports" tab in the Backend and click on "Link
users" and "Import issue types". The users will be matched either by login or by email.

Create and export a project
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Projects can be created in Odoo and exported to Jira. You can then create a
project, and use the action "Link with JIRA" and use the "Export to JIRA" action.

When you choose to export a project to JIRA, if you change the name
or the key of the project, the new values will be pushed to JIRA.

Link a project with JIRA
~~~~~~~~~~~~~~~~~~~~~~~~

If you already have a project on JIRA or prefer to create it first on JIRA,
you can link an Odoo project. Use the "Link with JIRA" action on the project
and select the "Link with JIRA" action.

This action establish the link, then changes of the name or the key on either
side are not pushed.

Issue Types on Projects
~~~~~~~~~~~~~~~~~~~~~~~

When you link a project, you have to select which issue types are synchronized.
Only tasks of the selected types will be created in Odoo.

If a JIRA worklog is added to a type of issue that is not synchronized,
will attach to the closest task following these rules:

* if a subtask, find the parent task
* if no parent task, find the epic task (only if it is on the same project)
* if no epic, attach to the project without being linked to a task

Change synchronization configuration on a project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to change the configuration of a project, such as which
issue types are synchronized, you can open the "Connector" tab in
the project settings and edit the "binding" with the backend.

Synchronize tasks and worklogs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If the webhooks are active, as soon as they are created in Jira they should appear in Odoo.
If they are not active, you can open the Jira Backend and run the
synchronizations manually, or activate the Scheduled Actions to run the batch
imports. It is important to select the issue types so don't miss this step (need improvement).

Known issues / Roadmap
======================

* If an odoo user has no linked employee, worklogs will still be imported but
with no employee.

**Allowing several bindings per project**

The design evolved to allow more than one Jira binding per project in Odoo.
This conveniently allows to fetch tasks and worklogs for many projects in Jira,
which will be tracked in only one project in Odoo.

In order to push data to Jira, we have to apply restrictions on these
"multi-bindings" projects, as we cannot know to which binding data must
be pushed:

* Not more than one project (can be zero) can have a "Sync Action" set to
"Export to JIRA". As this configuration pushes the name and key of the project
to Jira, we cannot push it to more than one project.
* If we implement push of tasks to Jira, we'll have to add a way to restrict or
choose to which project we push the task, this is not supported yet (for
instance, add a Boolean "export tasks" on the project binding, or explicitly
select the target binding on the task)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/connector-jira/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/connector-jira/issues/new?body=module:%20connector_jira%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Camptocamp

Contributors
~~~~~~~~~~~~


* Damien Crier
* Thierry Ducrest
* Tonow-c2c
* Simone Orsi <simahawk@gmail.com>
* Alexey Pelykh <alexey.pelykh@brainbeanapps.com>
* `Camptocamp <https://camptocamp.com>`_:

* Timon Tschanz <timon.tschanz@camptocamp.com>
* jcoux <julien.coux@camptocamp.com>
* Patrick Tombez <patrick.tombez@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Akim Juillerat <akim.juillerat@camptocamp.com>
* `Trobz <https://trobz.com>`_:

* Son Ho <sonhd@trobz.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/connector-jira <https://github.com/OCA/connector-jira/tree/15.0/connector_jira>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
8 changes: 8 additions & 0 deletions connector_jira/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import cli
from . import fields
from . import components
from . import controllers
from . import models
from . import wizards
49 changes: 49 additions & 0 deletions connector_jira/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "JIRA Connector",
"version": "15.0.1.0.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Connector",
"depends": [
"connector",
"project",
"hr_timesheet",
"queue_job",
"web",
"web_widget_url_advanced",
"multi_step_wizard",
],
"external_dependencies": {
"python": [
"requests",
"jira",
"oauthlib",
"requests-oauthlib",
"requests-toolbelt",
"PyJWT",
"cryptography",
],
},
"website": "https://github.com/OCA/connector-jira",
"data": [
"views/jira_menus.xml",
"wizards/jira_backend_auth_views.xml",
"views/project_link_jira_views.xml",
"views/task_link_jira_views.xml",
"views/jira_backend_views.xml",
"views/jira_backend_report_templates.xml",
"views/project_project_views.xml",
"views/project_task_views.xml",
"views/res_users_views.xml",
"views/jira_issue_type_views.xml",
"views/timesheet_account_analytic_line.xml",
"wizards/jira_account_analytic_line_import_views.xml",
"security/ir.model.access.csv",
"data/cron.xml",
"data/queue_job_data.xml",
],
"demo": ["demo/jira_backend_demo.xml"],
"installable": True,
}
3 changes: 3 additions & 0 deletions connector_jira/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import jira_oauth_dance