mediabounds / streamdeck-jira

A Stream Deck plugin for finding issues in Jira or content in Confluence
MIT License
10 stars 2 forks source link

Badge only shows a yellow ! No updates #1

Closed hellomrjones closed 1 year ago

hellomrjones commented 1 year ago

I use a non-cloud set up with my company, where I created a API Token in my profile and set it up accordingly. Instead of no. of issues found for the jql query, I only ever get a yellow "!". I don't know where to check errors or anything.

hellomrjones commented 1 year ago

When Checking the "My API tokens" it tells me it was never accessed.

mediabounds commented 1 year ago

The yellow ! means that some error was encountered during the network request to get issues. It can also appear if the JQL query was invalid.

I would first suggest double checking that...

If everything looks good there, then we need to look at Stream Deck's logs. The plugin will log error messages to the Stream Deck log. Logs are saved to disk per plugin in the folder ~/Library/Logs/StreamDeck/ on macOS and %appdata%\Elgato\StreamDeck\logs\ on Windows.

You're welcome to post the full log files here--but you might want to search through it first to see if any other plugins logged information you don't want to post.

I only have access to Jira Cloud and haven't tested this with an Jira Server/on-prem -- so hopefully there's not some limitation.

hellomrjones commented 1 year ago

Thanks for the swift reply. I checked all of the above.

This is the message getting repeated in the log: 11:50:53.7619 [Query] Received error while updating response: Unexpected token < in JSON at position 11

Doesn't give me much more insight, any idea? Thank you.

hellomrjones commented 1 year ago

I guess it's connected to this found in the StreamDeck0.log

09:25:57.5718 static std::string EGQTCredentialStore::GetPasswordWithServerAndUserName(): Failed to read in Keychain com.elgato.StreamDeck.com.mediabounds.streamdeck.jira due to error -25300

mediabounds commented 1 year ago

Hm--doesn't give me much insight either. But it does tell me that I need to improve error reporting. Give me a couple days and I'll prepare a beta version that improves visibility of the error messages. If you're willing to test that beta version, that will hopefully at least clarify why you're getting an error.

hellomrjones commented 1 year ago

I could imagine that my company setup of JIRA needs further authentication maybe? I can't set a password in the settings though. I'm happy to test it with you as I'm absolute keen in populating my StreamDeck with any JIRA/Confluence monitors I can.

mediabounds commented 1 year ago

I've just posted a beta version of the plugin that improves error reporting: https://github.com/mediabounds/streamdeck-jira/suites/10648388697/artifacts/532027288

Installing a debug plugin Unzip the file from the link above. It will contain a single file: `com.mediabounds.streamdeck.jira.streamDeckPlugin` When you launch it, Streamdeck will confirm that you want to install this plugin from the Internet: Screenshot 2023-01-29 at 1 35 57 PM Clicking **Install** will upgrade the version you installed from the Streamdeck store to this beta version. For transparency sake: all builds are produced by GitHub so you can see exactly what changed from the last version submitted to Elgato.

With this version, there is now a status indicator in the Property Inspector:

Screenshot 2023-01-29 at 1 31 58 PM

If there is something wrong (and a yellow ! appears on the icon) then the status indicator will change to:

Screenshot 2023-01-29 at 1 32 12 PM

Clicking on the status indicator will show a high-level reason for the problem:

Screenshot 2023-01-29 at 1 32 26 PM

Alt-clicking (i.e. right-clicking) on the status indicator will show a debug window with the response that was received from the server:

Screenshot 2023-01-29 at 1 32 49 PM

Would you be willing to try out this version and see what the debug window shows? I'm hoping this will lead us to the root cause about why the plugin doesn't work for you.

hellomrjones commented 1 year ago

Thanks! And this are the results:

Screenshot 2023-01-30 at 08 21 44

connection Keep-Alive content-security-policy frame-ancestors 'self' content-type text/html;charset=UTF-8 date Mon, 30 Jan 2023 07:28:59 GMT keep-alive timeout=5, max=100 referrer-policy strict-origin-when-cross-origin server Apache Tomcat strict-transport-security max-age=16070400; includeSubDomains, max-age=31536000 transfer-encoding chunked www-authenticate OAuth realm="https%3A%2F%2Fjira.REDACTED.com" x-anodeid backend1 x-arequestid 508x1345592x1 x-content-type-options nosniff x-frame-options allow-from https://jira.REDACTED.com/ x-seraph-loginreason AUTHENTICATED_FAILED x-xss-protection 1; mode=block

mediabounds commented 1 year ago

Okay, that helps--looks like there is a difference between Jira Cloud and Jira Server here.

The plugin uses Basic authentication -- which Jira Cloud supports with something called API tokens.

Apparently Jira Server does not have the same thing (there is something called Personal access tokens, but its different).

Based on the documentation for Jira Server, it looks like it does support Basic authentication, but in the field for API token, you should enter your Jira password.

Are you able to see if that works?

hellomrjones commented 1 year ago

It sadly doesn't help. Probably will not ever work with company wide single sign on in between, where I'd also would have to provide a 2FA Code in order to enter. Thanks for looking into it.

mediabounds commented 1 year ago

I'm going to look into supporting Personal Access Tokens. Based on the documentation, it doesn't seem like it'll be too challenging and hopefully it'll help others on Jira Server.

mediabounds commented 1 year ago

I just pushed up an updated beta with a (very) preliminary test to see if I'm on the right track with Personal Access Tokens: https://github.com/mediabounds/streamdeck-jira/suites/10677171564/artifacts/534097449

There is a new drop-down in the property inspector to toggle between Jira Cloud and Jira Server. You'll want to select Jira Server and make sure you have a Personal Access Token as described here: https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html

Screenshot 2023-01-30 at 9 26 17 PM

I have no way of testing this myself -- so I hope you don't mind give this a shot and letting me know the outcome.

Rigidoont commented 1 year ago

Hi! I have the same issue, and I just tried your updated beta. Sadly, it doesn't work and here's the error message when I click on "Something is not right": image

I made sure to select "Jira Server" and provided the correct Personal Access Token.

I also tried Alt-clicking and right-clicking the status indicator, but it always opens a dialog with the same message (screenshot above). I'm using Windows.

mediabounds commented 1 year ago

Thanks for the feedback @Gidoont -- curiously, it seems like your server is saying the response was successful, but then not providing the data we asked for. I just updated the beta build to try and handle this scenario so you get better debug data: https://github.com/mediabounds/streamdeck-jira/suites/10687778087/artifacts/534877192

If alt-clicking the status indicator still doesn't do anything, check the logs at %appdata%\Elgato\StreamDeck\logs\ to see if there's more information there.

Thanks for debugging with me!

Rigidoont commented 1 year ago

Great! Right-clicking status indicator works now, here's a screenshot: 223__31 01 2023_17 12 34__StreamDeck

Also, message displayed on the left-click has changed: 221__31 01 2023_17 11 19__StreamDeck

Here's the full text of it:
Log into Atlassian - Jira
var AJS=AJS110;AJS.debug=true;
(function() {
var contextPath =
function printDeprecatedMsg0 {
if (console && console.warn) {
console.warnCDEPRECATED JS - contextPath global variable has been deprecated since 7.4.0. Use •wrm/context-path& module instead.');
Object.defineProperty(window, •contextPath', {
get: function0 {
printDeprecatedMsg0;
return contextPath;
set: function(value) {
printDeprecatedMsg0;
contextPath = value;
window.WRM=window.WRMll{};window.WRM._unparsedData=window.WRM._unparsedDatall
0;window.WRM._unparsedErrors=window.WRM._unparsedErrorsll{};
\"";
WRM._unparsedData["jira.core:feature-flags-data.feature-flag-data"]="{\"enabled-feature-keys\":
[\"com.atlassian.jira.agile.darkfeature.editable.detailsview\",\"nps.survey.inline.dialog\",
\"com.atlassian.jira.agile.darkfeature.edit.closed.sprint.enabled\",\"jira.plugin.devstatus.phasetwo\",
\"jira.frother.reporter.field\",\"atlassian.rest.xsrf.legacy.enabled\",\"jira.issue.status.lozenge\",
\"public.access.disabled\",\"com.atlassian.jira.config.BlG_PlPE\",\"com.atlassian.jira.projects.issuenavigator\",
\"com.atlassian.jira.config.PDL\",\"jira.plugin.devstatus.phasetwo.enabled\",\"atlassian.aui.raphael.disabled\",
\&[quot;app-switcher.new](http://quot%3Bapp-switcher.new/)\",\"frother.assignee.field\",\"com.atlassian.jira.projects.ProjectCentricNavigation.Switch\",
\"sd.internal.base.off.thread.on.completion.events.enabled\",\"jira.onboarding.cyoa\",
\"sd.slavalue.record.updated.date.enabled\",\"com.atlassian.jira.agile.darkfeature.kanplan.enabled\",
\"com.atlassian.jira.config.ProjectConfig.MENU\",\"com.atlassian.jira.projects.sidebar.DEFER_RESOURCES\",
\"com.atlassian.jira.agile.darkfeature.kanplan.epics.and.versions.enabled\",
\"com.atlassian.jira.agile.darkfeature.sprint.goal.enabled\",\"jira.zdu.admin-updates-ui\",\"jira.zdu.jmx-
monitoring\",\"sd.sla.improved.rendering.enabled\",\"sd.canned.responses.enabled\",
\"mail.batching.enabled\",\"sd.new.settings.sidebar.location.disabled\",\"jira.zdu.cluster-upgrade-state\",
\"com.atlassian.jira.email.templates.readFromJiraHome\",\"com.atlassian.jira.agile.darkfeature.splitissue\",
\"com.atlassian.jira.config.CoreFeatures.LlCENSE_ROLES_ENABLED\",\"jira.export.csv.enabled\"],\"feature-flag-
states\":{\"com.atlassian.jira.agile.darkfeature.handle.ug.usernames\":true,
\"com.atlassian.jira.security.endpoint.non.admin.access.screens\":false,
\"sd.automation.then.action.edit.issue.custom.fields\":true,\"sd.custom.email.stripping.rules\":false,
\"com.atlassian.jira.webhookEventsAsyncProcessing\":false,\"com.atlassian.jira.serAllowShareWithNonMember\":true,
& uot•sd.confluence.redirect.with.•wt.token.a ent & uot•:true & uot:com.atlassian.•ira.issuetable.move.links.hidden & uot•:true
\"sd.automation.then.webhook.custom.payload\":true,\"sd.use.search.by.permissions\":true,
\"com.atlassian.jira.security.endpoint.anonymous.access.resolution\":false,
\"com.atlassian.jira.agile.darkfeature.sprint.goal\":false,\"sd.automation.ruleset.cache\":true,
\"sd.confluence.cloud.integration\":true,\"jira.cluster.monitoring.show.offline.nodes\":true,
\"sd.kb.cloud.always.primary\":false,\"com.atlassian.jira.commentReactions\":true,
\"sd.approval.requested.when.handler\":true,\"com.atlassian.jira.custom.csv.escaper\":true,
\"com.atlassian.jira.fixedCommentDeletionNotifications\":true,\"com.atlassian.jira.allThumbnailsDeferred\":false,
\"com.atlassian.jira.plugin.issuenavigator.filtersuxlmprovment\":true,\"jira.customfields.cleanup.identification\":true,
\"com.atlassian.jira.defaultValuesForSystemFields\":true,\"sd.queue.react.table\":true,
\"sd.automation.then.action.archive.issue\":true,\"sd.customerportal.sla.customer.visibility\":true,
\"jira.customfields.bulk.delete\":true,\&[quot;sd.email.analytics.open](http://quot%3Bsd.email.analytics.open/)\":false,
\"com.atlassian.jira.returnDefaultAvatarsForBrokenAvatars\":true,\"sd.kb.cloud.allow.http\":false,
\"jira.jql.suggestrecentfields\":false,\"com.atlassian.jira.gdpr.rtbf\":true,
\"com.atlassian.jira.security.xsrf.session.token\":true,\"sd.dismiss.all.misconfiguration.warnings.setting\":true,
\"com.atlassian.jira.security.project.admin.revoke.with.application.access\":true,\"com.atlassian.jiranomenclature\":true,
\"com.atlassian.jira.security.endpoint.non.admin.access.avatar.system\":false,
\"sd.canned.responses.variable.substitution\":true,\"com.atlassian.jira.agile.darkfeature.future.sprint.dates\":true,
\"jira.customfields.paginated.ui\":true,\"insight.db.import.h2.enable\":false,
\"sd.incident.management.feature.polling\":true,\"com.atlassian.jira.advanced.audit.log\":true,
\"sd.automation.then.webhook\":true,\"sd.priorities.per.project\":true,\"external.links.new.window\":true,
\"sd.customer.portal.browse.permission.only\":true,\"sd.inline.noformat.renderer\":true,
\"sd.customer.profile.multi.languages\":true,\"data.pipeline.feature.jira.issue.history.export\":true,
\"sd.new.settings.sidebar.location\":true,\"atlassian.cdn.static.assets\":true,
\"com.atlassian.jira.security.endpoint.non.browse.projects.access.fields\":false,\"sd.customer.search.post.agent.filtering\":true,
\"sd.sla.improved.rendering\":false,\"mail.batching\":false,\&[quot;sd.kb.cloud.allow.empty.display.name](http://quot%3Bsd.kb.cloud.allow.empty.display.name/)\":false,
\"com.atlassian.jira.security.endpoint.anonymous.access.priority\":false,\"jira.priorities.per.project.edit.default\":false,
\"com.atlassian.jira.agile.darkfeature.issues.in.epic.details.view\":true,\"jira.priorities.per.project.jsd\":true,
\"sd.email.attachment.stripping\":false,\"com.atlassian.jira.agile.darkfeature.rapid.boards.bands\":true,
\"com.atlassian.jira.agile.darkfeature.flexible.boards\":true,\"com.atlassian.jira.agile.darkfeature.epic.validate.visibility\":true,
\"com.atlassian.jira.send.email.notifications.to.user.without.application.access\":false,
\"com.atlassian.mail.server.managers.hostname.verification\":true,\"sd.automation.then.action.auto.answer.approval\":true,
\"sd.approvals.notification.email.action\":true,\"com.atlassian.jira.upgrade.startup.fix.index\":true,
\"sd.email.attachments.store.duplicates\":false,\&[quot;sd.customer.notifications.suppress.welcome.email](http://quot%3Bsd.customer.notifications.suppress.welcome.email/)\":true,
\"sd.sla.fix.timeline\":false,\"sd.customer.share.default.private\":true,
\"com.atlassian.jira.security.endpoint.anonymous.access.projectCategory\":false,\"jira.redirect.anonymous.404.errors\":true,
\"sd.customerportal.card.view\":true,\"com.atlassian.jira.issuetable.draggable\":true,
\"sd.email.microsoft.pop.two.line.auth\":true,\"com.atlassian.jira.attachments.generate.unique.suffix\":true,
\"sd.customerportal.customization.preview\":true,\"sd.customer.portal.wysiwyg.editor\":true,
\"jira.version.based.node.reindex.service\":true,\"sd.attachment.is.viewable.short.circuit\":true,
\"com.atlassian.jira.security.endpoint.anonymous.access.issueLinkType\":false,
\"sd.email.channel.custom.oauth.config.supported\":false,\&[quot;sd.internal.base.off.thread.on.completion.events](http://quot%3Bsd.internal.base.off.thread.on.completion.events/)\":false,
\"com.atlassian.jira.agile.darkfeature.burnupchart\":true,\"jira.instrumentation.laas\":false,
\"sd.no.schedule.async.upgrade.tasks\":true,\"sd.customer.portal.editor.mentions\":true,
\"sd.approvals.with.insight\":true,\"mail.batching.user.notification\":true,
\"com.atlassian.portfolio.permission.check.for.permissions\":true,\"sd.portal.search.bar.settings\":true,
\"sd.sla.auto.fix.metric\":true,\"sd.sla.audit.log.smart.cleanup\":true,\"com.atlassian.jira.issues.archiving\":true,
\"sd.automation.if.condition.comment.primary.action\":true,\"jira.priorities.per.project\":true,
\"com.atlassian.jira.use.same.site.none.for.xsrf.token.cookie\":true,
\"com.atlassian.jira.mailHandlerlmapMessageQueryLegacy\":false,\"com.atlassian.jira.diagnostics.perflog\":true,
\&[quot;sd.event.processing.stop.unnecessary.processing.of.jira.issue.events](http://quot%3Bsd.event.processing.stop.unnecessary.processing.of.jira.issue.events/)\":false,\"sd.prioritise.agent.role\":true,
\"com.atlassian.jira.dbr\":true,\"com.atlassian.jira.agile.darkfeature.legacy.epic.picker\":false,
\"com.atlassian.jira.agile.darkfeature.unlink.sprints.on.issue.move\":true,\"sd.incident.management.feature\":true,
\"com.atlassian.jira.user.dbldBasedKeyGenerationStrategy\":true,\"sd.signup.email.verification\":true,
\"sd.language.support.administration\":true,\"com.atlassian.jira.thumbnailsDeferredGeneration\":true,
\"sd.automation.psmq.async.executor\":true,\"data.pipeline.feature.jira.issue.links.export\":true,
\"com.atlassian.jira.agile.darkfeature.kanplan.epics.and.versions\":false,\&[quot;com.atlassian.jira.jsd.mobile](http://quot%3Bcom.atlassian.jira.jsd.mobile/)\":true,
\"data.pipeline.feature.jira.all.exportable.custom.fields\":true,\"jira.dc.cleanup.cluser.tasks\":true,
\"sd.sla.performance.optimization\":true,\"sd.cluster.safe.mail.channel.shutdown\":true,
\"com.atlassian.jira.issues.archiving.filters\":false,\"mail.batching.override.core\":true,
\"jira.users.and.roles.page.in.react\":true,\"jira.security.csp.sandbox\":true,
\"com.atlassian.jira.agile.darkfeature.velocity.chart.ul\":true,\"insight.index.object.type.reindex.on.failure\":true,
\"sd.automation.audit.log\":true,\&[quot;com.atlassian.jira.agile.darkfeature.sprint.auto.management](http://quot%3Bcom.atlassian.jira.agile.darkfeature.sprint.auto.management/)\":false,
\"sd.workinghours.react.component\":false,\"com.atlassian.jira.agile.darkfeature.optimistic.transitions\":true,
\"sd.queue.bulk.actions\":true,\&[quot;sd.internal.base.db.backed.completion.events](http://quot%3Bsd.internal.base.db.backed.completion.events/)\":false,
\"sd.incident.management.allow.http\":false,\"com.atlassian.jira.agile.darkfeature.kanplan\":false,
\"com.atlassian.jira.filtersAndDashboardsShareableWithAllGroupsAndRoles\":true,
\"com.atlassian.jira.agile.darkfeature.edit.closed.sprint\":false.\"jira.create.linked.issue\":true,
& uot•sd.automation. ro•ect.runasuser.cache & uot::true & uot•sd.custome ortal.c

Thank you for developing this plugin, looks very promising!

hellomrjones commented 1 year ago

After installing the new version, creating a new API Token and choosing "JIRA Server" I now get this: image

And on the Debug:

Screenshot 2023-01-31 at 17 05 42

mediabounds commented 1 year ago

@hellomrjones / @Gidoont Can you both share what version of Jira Server you're on (if you know)?

In both cases, it seems like the personal access token worked: I presume the reason you both blocked out the x-ausername field is because it was your user name was displayed there. The only way it would have gotten that is if the PAT did work.

But it seems like the API request fails...in both cases, it seems like it didn't even make it to the API endpoint. So I need to look through the documentation for Jira Server to see if the API endpoint is different than Jira Cloud.

mediabounds commented 1 year ago

I did just have an idea -- if you're willing to continue in my path of guess-and-checking, here's an updated beta version: https://github.com/mediabounds/streamdeck-jira/suites/10693836547/artifacts/535307608

Based on my reading, it sounds like most server instances have a different API version than Jira Cloud.

Rigidoont commented 1 year ago

It works!! image

Thank you very much for putting in the effort to address this problem! My Jira version is v8.20.9.

mediabounds commented 1 year ago

Thank you both again for reporting and helping me test this. I've formalized the release and sent it off to Elgato so it should be available on the plugin store in a few days (or available immediately from the releases page).

hellomrjones commented 1 year ago

Can also confirm it's working! Thanks sooooo much! If you get the time and are interested, same for confluence would be amazing as well! Now I will show off this amazing plugin in my stream deck to the whole organisation :)