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
14 changes: 7 additions & 7 deletions airflow/providers/atlassian/jira/operators/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class JiraOperator(BaseOperator):
JiraOperator to interact and perform action on Jira issue tracking system.
This operator is designed to use Atlassian Jira SDK: https://atlassian-python-api.readthedocs.io/jira.html

:param jira_conn_id: reference to a pre-defined Jira Connection
:param jira_method: method name from Atlassian Jira Python SDK to be called
:param jira_method_args: required method parameters for the jira_method. (templated)
:param result_processor: function to further process the response from Jira
:param get_jira_resource_method: function or operator to get jira resource
on which the provided jira_method will be executed
:param jira_conn_id: Reference to a pre-defined Jira Connection.
:param jira_method: Method name from Atlassian Jira Python SDK to be called.
:param jira_method_args: Method parameters for the jira_method. (templated)
:param result_processor: Function to further process the response from Jira.
:param get_jira_resource_method: Function or operator to get Jira resource on which the provided
jira_method will be executed.
"""

template_fields: Sequence[str] = ("jira_method_args",)
Expand All @@ -54,7 +54,7 @@ def __init__(
super().__init__(**kwargs)
self.jira_conn_id = jira_conn_id
self.method_name = jira_method
self.jira_method_args = jira_method_args
self.jira_method_args = jira_method_args or {}
self.result_processor = result_processor
self.get_jira_resource_method = get_jira_resource_method

Expand Down
7 changes: 7 additions & 0 deletions tests/providers/atlassian/jira/operators/test_jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def setup_method(self):
)
)

def test_operator_init_with_optional_args(self):
jira_operator = JiraOperator(task_id="jira_list_issue_types", jira_method="issue_types")

assert jira_operator.jira_method_args == {}
assert jira_operator.result_processor is None
assert jira_operator.get_jira_resource_method is None

@patch("airflow.providers.atlassian.jira.hooks.jira.Jira", autospec=True, return_value=jira_client_mock)
def test_issue_search(self, jira_mock):
jql_str = "issuekey=TEST-1226"
Expand Down