Skip to content
代码片段 群组 项目
未验证 提交 7fcfe116 编辑于 作者: Phillip Wells's avatar Phillip Wells 提交者: GitLab
浏览文件

Merge branch 'docs/add-manual-comment-post-script' into 'master'

Add manual comment post script

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/157361



Merged-by: default avatarPhillip Wells <pwells@gitlab.com>
Approved-by: default avatarPhillip Wells <pwells@gitlab.com>
Co-authored-by: default avatarAnton Smith <asmith@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -68,6 +68,31 @@ curl --verbose --user "$USER:$API_TOKEN" "https://$ATLASSIAN_SUBDOMAIN.atlassian
If the user can access the issue, Jira responds with a `200 OK` and the returned JSON includes the Jira issue details.
### Verify GitLab can post a comment to a Jira issue
WARNING:
Commands that change data can cause damage if not run correctly or under the right conditions. Always run commands in a test environment first and have a backup instance ready to restore.
To help troubleshoot your Jira integration, you can check whether
GitLab can post a comment to a Jira issue using the project's Jira
integration settings.
To do so:
- From a [Rails console](../../administration/operations/rails_console.md#starting-a-rails-console-session),
run the following:
```ruby
jira_issue_id = "ALPHA-1" # Change to your Jira issue ID
project = Project.find_by_full_path("group/project") # Change to your project's path
integration = project.integrations.find_by(type: "Integrations::Jira")
jira_issue = integration.client.Issue.find(jira_issue_id)
jira_issue.comments.build.save!(body: 'This is a test comment from GitLab via the Rails console')
```
If the command is successful, a comment is added to the Jira issue.
## GitLab cannot create a Jira issue
When you try to create a Jira issue from a vulnerability, you might see a "field is required" error. For example, `Components is required` because a field called
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册