Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,9 @@ the following format:

issue-tracker:
- type: jira
url: https://issues.redhat.com
url: https://redhat.atlassian.net
tmt-web-url: https://tmt.testing-farm.io/
email: <EMAIL_ADDRESS_USED_FOR_LOGIN>
token: <YOUR_PERSONAL_JIRA_TOKEN>

The ``type`` key specifies the type of the issue tracking service
Expand Down
6 changes: 6 additions & 0 deletions docs/releases/pending/4879.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description:
The Jira integration has been updated so that the ``tmt link``
and the ``tmt test create`` commands correctly link tests or
plans to related issues in the new Jira Cloud instance. The
``email`` key is now required in the ``issue-tracker`` config
Comment thread
psss marked this conversation as resolved.
file. See the :ref:`link-issues` section for an example.
2 changes: 2 additions & 0 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def test_link_config_invalid(config_path: Path, root_logger: Logger):
- type: jiRA
url: invalid_url
tmt-web-url: https://
email: email@example.com
unknown: value
additional_key:
foo: bar
Expand Down Expand Up @@ -120,6 +121,7 @@ def test_link_config_valid(config_path: Path, root_logger: Logger):
- type: jira
url: https://issues.redhat.com
tmt-web-url: https://tmt-web-url.com
email: email@example.com
token: secret
""").strip()
fmf.Tree.init(path=config_path)
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,7 @@ def setUp(self):
- type: jira
url: https://issues.redhat.com
tmt-web-url: https://tmt.testing-farm.io/
email: email@example.com
token: secret
""".strip()
self.config_tree = fmf.Tree(data=tmt.utils.yaml_to_dict(config_yaml))
Expand Down
1 change: 1 addition & 0 deletions tmt/config/models/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class IssueTracker(MetadataContainer):
type: IssueTrackerType
url: HttpUrl
tmt_web_url: HttpUrl
email: str
Comment thread
psss marked this conversation as resolved.
token: str


Expand Down
3 changes: 2 additions & 1 deletion tmt/utils/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(self, issue_tracker: IssueTracker, logger: tmt.log.Logger):

self.url = str(issue_tracker.url)
self.tmt_web_url = str(issue_tracker.tmt_web_url)
self.email = issue_tracker.email
self.token = issue_tracker.token

self.logger = logger
Expand All @@ -83,7 +84,7 @@ def __init__(self, issue_tracker: IssueTracker, logger: tmt.log.Logger):
# ignore[attr-defined]: it is defined, but mypy seems to fail
# detecting it correctly.
self.jira = jira_module.JIRA( # type: ignore[attr-defined]
server=self.url, token_auth=self.token
server=self.url, basic_auth=(self.email, self.token)
)
Comment thread
psss marked this conversation as resolved.

@classmethod
Expand Down
Loading