Discourse Jira

AI-generated summary

The Discourse Jira plugin synchronizes projects, issue types, fields, and statuses, allowing users to create Jira issues from Discourse posts via webhooks. Configuration requires setting the Jira URL, username, and API key, along with defining allowed groups and webhook tokens 1.

Users have raised several feature requests to improve visibility and control. Jordan Violet and Colin McKibben suggested making ticket statuses visible to non-admins, mapping statuses to tags, detaching tickets, and specifying granular visibility levels for sensitive information. Nathank and Putty echoed the need for better group permissions to avoid granting site-wide moderation privileges. The developer, Vinothkannans, acknowledged these suggestions 6, and Benji later updated the plugin to include group permissions, defaulting to Admins but allowing other groups to create tickets 14.

Support discussions highlighted configuration challenges. Ckshen encountered 500 errors, which were resolved by correcting the webhook token placement and ensuring the Jira URL lacked a path 9, 10. However, they noted UI confusion where the “Create” and “Attach” buttons appeared reversed 10. Vinothkannans confirmed these UI bugs would be fixed 11.

Compatibility issues were also discussed. The plugin is built for Jira Cloud and may not work with Jira Data Center/Server 15, 16. Adam_Skalicky successfully linked an internal Jira instance by adding the host to allowed internal hosts 17. El.duderino reported persistent 403 errors with Jira Data Center 20. Additionally, Moin reported an incompatibility with the reactions plugin on iOS mobile 19.

:discourse: Summary Discourse Jira synchronizes projects, issue types, fields, issue statuses and manages the issues.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-jira
:open_book: Install Guide How to install plugins in Discourse

Features

  • Jira projects, issue types, fields and field options will be synced automatically.
  • Create a new Jira issue for a Discourse post with the dynamic issue creation form.
  • Attach an existing Jira issue to a Discourse post.
  • Sync the status of Jira issue using the webhooks.

Screenshots

Post Menu

Configuration

Set the values for site settings below before enabling the plugin.

  • discourse_jira_url: Put the URL of your Jira instance. It should end with / symbol.
  • discourse_jira_username: The username of the user whose behalf of going to create issues.
  • discourse_jira_password: The API key that is assigned to the user who creates issues. A password might work but is unsafe and the API was deprecated by Atlassian.
  • discourse_jira_enabled: Enable the Jira plugin for Discourse.
  • discourse_jira_allowed_groups: Select groups to have access to the Jira plugin features. Defaults to admin and mods.

Webhook

Set a secret token to verify the incoming webhooks from Jira.

  • discourse_jira_webhook_token: This token must be passed in the ‘t’ query parameter of the webhook.

For example, given that the webhook token is supersecret, and your base Discourse URL is discourse.example.com, you would set up the webhook URL as https://discourse.example.com/jira/issues/webhook?t=supersecret in the webhook settings for your Jira instance.

For just checking that the webhook is triggered and the emitted body is correct, you may opt to use external websites like RequestBin or Webhook.site to setup temporary webhook URLs.

Debugging

discourse_jira_verbose_log: Enable this setting to log the payloads of both the incoming webhooks and outgoing API requests.

:discourse2: Hosted by us? This plugin is available on our Enterprise plan.

Last edited by @benji 2024-08-22T20:44:40Z

Check documentPerform check on document:
10 Likes

@vinothkannans we’ve noticed that our users cannot actually see the status of these tickets, that only admins can see them. Can anything be done to make the “status” more visible to users?

One option could be of course making that quote block visible, or it would also be nice if you could map Jira statuses to tags, and that the topic tag updated to reflect the ticket progress (#backlog, #in-progress, #complete, etc.).

To piggy back off of Jordan, I have some additional ideas to improve this plugin.

  1. Ability to detach a JIRA ticket. I don’t see an option to detach or delete a JIRA ticket that I linked to a post.
  2. Choose which groups can see attached JIRA tickets. Right now it only looks like site admins can see them, but we would like the option to select one or more additional groups that can see them.
  3. Visibility levels. Ability to specify which part(s) of the ticket will appear to non-admins. For example, maybe we want all groups to see the ticket number and status, but not the title of the ticket, which may contain sensitive information. Then, we can specify trusted groups that can see the ticket title.
2 Likes

Your suggestions would really enhance the experience with this plugin.

We really need to have the content be able to be revealed to a specified group (that isn’t admins).

Is there a OpenProject version of this? Would be great to have since we use OpenProject for managing our tasks.

@jordan-violet @colin.mckibben these are good suggestions to make the plugin more useful. I will keep this in mind when I work on it next time.

1 Like

Hi, I have a question about configuring the plugin. I have been getting 500 errors when creating/ attaching issue so I think my settings are not entirely right. What did i do wrong?

First, I copied and pasted where I normally accessed my Jira instance into discourse jira url, although I am not completely certain about the URL since dependent on the selected Jira view the URL is different.

First, I set a random discourse jira username, with the discourse jira password copied and pasted from a generated Atlassian API token.



Then I added a Jira Webhook and set the URL of the Jira webhook to the URL of my discourse instance plus /jira/issues/webhook?t=

Then I set the Webhook secret, and copy and paste that secret back to the plugin config field discourse jira webhook token.

Any thoughts? Help much appreciated! Thanks.

Can anyone share your working plugin settings in Discourse (without the password/ token of course) so I can see how you get it to work? Thanks!

I copied the webhook token back into the URL in the Jira webhook setup, so it says https://example.com/jira/issues/webhook?t=abcdefghijk, and also your discourse_jira_url is supposed to be https://modernsquared.atlassian.net/ without the path.

@vinothkannans I have another question though: Is it possible to change which issue is attached to a topic after attaching, or simply remove/delete the attachment? If not, have you thought about implementing it?

Thanks @mikael.gundhus , I was able to get the plugin to connect to Jira.

But I ran into some oddity. I am not sure if I am the only one running into this issue, but the button Create and Attach issues seems to be reversed? When I click on the Create Issue button the plugin takes me to the attach issue screen:

And when I click on the Attach issue button the plugin takes me to the create issue screen: MS-155 is an existing issue in Jira. If I type in a new issue, say, MS-200, which doesn’t exist in Jira, it tells me An error occurred: You are not permitted to view the requested resource.

@mikael.gundhus yes, there should be an option to remove the existing attachment. @ckshen seems like it have wrong headings on modal windows. We will work on these in next iteration.

Are there plans to make this accessible to users who aren’t admins/mods? We have internal teams that are looking to move their operations to Discourse, and as it stands, the only way for them to use the JIra tool is by giving them site-wide moderation privileges.

4 Likes

I’ve just updated this plugin with Group permissions! It defaults to and must always include Admins, but with this update users can now make Jira tickets without needing to be Admin-level. Enjoy!

5 Likes

Hey Folks,

Has anyone successfully got this plugin working with Jira server or Datacenter?

I am not seeing any attachment option and seeing an error in the logs.

Job exception: DiscourseJira::InvalidURI

1 Like

So far we’ve only built this plugin using APIs for Jira Cloud. So you might not be successful with Jira DC.

Jira Cloud REST doc: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-get
Jira DC/Server REST doc: https://developer.atlassian.com/server/jira/platform/jira-rest-api-examples

1 Like

Thanks Natalie, after adding our host to the allowed internal hosts under Security, we were able to link and create issues. This probably is helpful to know for anyone using an internal instance of Jira. Still working on comment sync but I believe that is a config issue.

3 Likes

Does this feature work with Jira Service Management Projects as well?

Seems there is an incompatibility between jira and reactions

1 Like

I have tried this on our self-hosted jira datacentre instance, but seem to be stuck - I would really appreciate it if you could help.

TL;DR - I’m getting a 403 and HTML returned when it should be giving a 201 and JSON:

`/var/www/discourse/plugins/discourse-jira/lib/discourse_jira/api.rb:63:in ‘DiscourseJira::Api.getJSON’`

  • I have created the Jira Personal Access Token
  • I have tried several paths for the API : /, /rest,/rest/api, /rest/api/latest :left_arrow: I have checked that the last one works.
  • No matter what I keep getting returned HTML instead of JSON.

I suspect I’m doing something wrong with the plugin configuration, but I can’t tell what. If anyone has gotten this to work with JIRA datacentre, I’d love to pick you brains!

Thanks

Bruce