Commit f0a70e7e authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '263371-transition-id-section-should-include-help-text' into 'master'

Add help text to Jira transition ID form field

See merge request gitlab-org/gitlab!49204
parents 4405e6aa c1e074f6
...@@ -122,12 +122,15 @@ class JiraService < IssueTrackerService ...@@ -122,12 +122,15 @@ class JiraService < IssueTrackerService
end end
def fields def fields
transition_id_help_path = help_page_path('user/project/integrations/jira', anchor: 'obtaining-a-transition-id')
transition_id_help_link_start = '<a href="%{transition_id_help_path}" target="_blank" rel="noopener noreferrer">'.html_safe % { transition_id_help_path: transition_id_help_path }
[ [
{ type: 'text', name: 'url', title: s_('JiraService|Web URL'), placeholder: 'https://jira.example.com', required: true }, { type: 'text', name: 'url', title: s_('JiraService|Web URL'), placeholder: 'https://jira.example.com', required: true },
{ type: 'text', name: 'api_url', title: s_('JiraService|Jira API URL'), placeholder: s_('JiraService|If different from Web URL') }, { type: 'text', name: 'api_url', title: s_('JiraService|Jira API URL'), placeholder: s_('JiraService|If different from Web URL') },
{ type: 'text', name: 'username', title: s_('JiraService|Username or Email'), placeholder: s_('JiraService|Use a username for server version and an email for cloud version'), required: true }, { type: 'text', name: 'username', title: s_('JiraService|Username or Email'), placeholder: s_('JiraService|Use a username for server version and an email for cloud version'), required: true },
{ type: 'password', name: 'password', title: s_('JiraService|Password or API token'), placeholder: s_('JiraService|Use a password for server version and an API token for cloud version'), required: true }, { type: 'password', name: 'password', title: s_('JiraService|Password or API token'), placeholder: s_('JiraService|Use a password for server version and an API token for cloud version'), required: true },
{ type: 'text', name: 'jira_issue_transition_id', title: s_('JiraService|Transition ID(s)'), placeholder: s_('JiraService|Use , or ; to separate multiple transition IDs') } { type: 'text', name: 'jira_issue_transition_id', title: s_('JiraService|Jira workflow transition IDs'), placeholder: s_('JiraService|For example, 12, 24'), help: s_('JiraService|Set transition IDs for Jira workflow transitions. %{link_start}Learn more%{link_end}'.html_safe % { link_start: transition_id_help_link_start, link_end: '</a>'.html_safe }) }
] ]
end end
......
---
title: Resolve Transition ID section should include help text
merge_request: 49204
author:
type: added
...@@ -83,7 +83,7 @@ Enter the further details on the page as described in the following table. ...@@ -83,7 +83,7 @@ Enter the further details on the page as described in the following table.
| `Jira API URL` | The base URL to the Jira instance API. Web URL value is used if not set. For example, `https://jira-api.example.com`. Leave this field blank (or use the same value of `Web URL`) if using **Jira Cloud**. | | `Jira API URL` | The base URL to the Jira instance API. Web URL value is used if not set. For example, `https://jira-api.example.com`. Leave this field blank (or use the same value of `Web URL`) if using **Jira Cloud**. |
| `Username or Email` | Created in [configuring Jira](#configuring-jira) step. Use `username` for **Jira Server** or `email` for **Jira Cloud**. | | `Username or Email` | Created in [configuring Jira](#configuring-jira) step. Use `username` for **Jira Server** or `email` for **Jira Cloud**. |
| `Password/API token` |Created in [configuring Jira](#configuring-jira) step. Use `password` for **Jira Server** or `API token` for **Jira Cloud**. | | `Password/API token` |Created in [configuring Jira](#configuring-jira) step. Use `password` for **Jira Server** or `API token` for **Jira Cloud**. |
| `Transition ID` | Required for closing Jira issues via commits or merge requests. This is the ID of a transition in Jira that moves issues to a desired state. (See [Obtaining a transition ID](#obtaining-a-transition-id).) If you insert multiple transition IDs separated by `,` or `;`, the issue is moved to each state, one after another, using the given order. | | `Jira workflow transition IDs` | Required for closing Jira issues via commits or merge requests. These are the IDs of transitions in Jira that move issues to a particular state. (See [Obtaining a transition ID](#obtaining-a-transition-id).) If you insert multiple transition IDs separated by `,` or `;`, the issue is moved to each state, one after another, using the given order. In GitLab 13.6 and earlier, field was called `Transition ID`. |
To enable users to view Jira issues inside the GitLab project, select **Enable Jira issues** and enter a Jira project key. **(PREMIUM)** To enable users to view Jira issues inside the GitLab project, select **Enable Jira issues** and enter a Jira project key. **(PREMIUM)**
......
...@@ -15684,6 +15684,9 @@ msgstr "" ...@@ -15684,6 +15684,9 @@ msgstr ""
msgid "JiraService|Events for %{noteable_model_name} are disabled." msgid "JiraService|Events for %{noteable_model_name} are disabled."
msgstr "" msgstr ""
msgid "JiraService|For example, 12, 24"
msgstr ""
msgid "JiraService|If different from Web URL" msgid "JiraService|If different from Web URL"
msgstr "" msgstr ""
...@@ -15708,19 +15711,19 @@ msgstr "" ...@@ -15708,19 +15711,19 @@ msgstr ""
msgid "JiraService|Jira project key" msgid "JiraService|Jira project key"
msgstr "" msgstr ""
msgid "JiraService|Open Jira" msgid "JiraService|Jira workflow transition IDs"
msgstr "" msgstr ""
msgid "JiraService|Password or API token" msgid "JiraService|Open Jira"
msgstr "" msgstr ""
msgid "JiraService|This feature requires a Premium plan." msgid "JiraService|Password or API token"
msgstr "" msgstr ""
msgid "JiraService|Transition ID(s)" msgid "JiraService|Set transition IDs for Jira workflow transitions. %{link_start}Learn more%{link_end}"
msgstr "" msgstr ""
msgid "JiraService|Use , or ; to separate multiple transition IDs" msgid "JiraService|This feature requires a Premium plan."
msgstr "" msgstr ""
msgid "JiraService|Use a password for server version and an API token for cloud version" msgid "JiraService|Use a password for server version and an API token for cloud version"
......
...@@ -66,6 +66,19 @@ RSpec.describe JiraService do ...@@ -66,6 +66,19 @@ RSpec.describe JiraService do
end end
end end
describe '#fields' do
let(:service) { create(:jira_service) }
subject(:fields) { service.fields }
it 'includes transition help link' do
transition_id_field = fields.find { |field| field[:name] == 'jira_issue_transition_id' }
expect(transition_id_field[:title]).to eq('Jira workflow transition IDs')
expect(transition_id_field[:help]).to include('/help/user/project/integrations/jira')
end
end
describe 'Associations' do describe 'Associations' do
it { is_expected.to belong_to :project } it { is_expected.to belong_to :project }
it { is_expected.to have_one :service_hook } it { is_expected.to have_one :service_hook }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment