Commander Commander
Commander
621 views

SSC 20.1 to JIRA cloud Integration

Jump to solution

Currently i'm trying to do this integration between SSC 20.1 and Jira Cloud.
we got to point as far as having valid connectivity to jira cloud. using registered username and API token as password.

But when we try to file a bug to jira. we got error messages, something like the field name is mismatch. We also tried switching field name from 'Bug' to 'Task' and error still happened.

this is one of the error sample

===========================
2020-08-03T10:08:02,763 | ERROR | pool-10-thread-1 | BugTrackerLegacyMessageHandler | 23 - com.fortify.plugin.camel.bugtracker - 20.1.0.0153 | Error while handling BTGetBatchBugParameters
com.fortify.pub.bugtracker.support.BugTrackerException: Error while setting Jira fields configuration: JSONObject["name"] not found.
============================

we believe integration using the SSC plugin shipped with the SSC installer is compatible to JIRA 8.x as this is can be found in document. But we're just not sure on compatibility with JIRA cloud.

we got the logs attached, for reference.

anybody have ideas on this ?

0 Likes
1 Solution

Accepted Solutions
Commander Commander
Commander

Nevermind guys,

I should have read the error logs further before.
we've managed to have working plugin build for current JIRA cloud. 

You can find the new plugin jar in the attachment. Just rename the file ext to .jar

==================

For those, who's interested in the issue details, here's what we found:

in plugin-framework.log,
it's saying exactly where the problem is:

2020-08-03T10:02:50,182 | ERROR | pool-10-thread-1 | BugTrackerLegacyMessageHandler | 23 - com.fortify.plugin.camel.bugtracker - 20.1.0.0153 | Error while handling BTGetBatchBugParameters
com.fortify.pub.bugtracker.support.BugTrackerException: Error while setting Jira fields configuration: JSONObject["name"] not found.
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.getBugParameters(JiraBatchBugTrackerPlugin.java:230) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.getBatchBugParameters(JiraBatchBugTrackerPlugin.java:202) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
at com.fortify.plugin.runtime.helpers.BundleUtils$PluginInvocationHandler.invoke(BundleUtils.java:196) ~[?:?]
at com.sun.proxy.$Proxy288.getBatchBugParameters(Unknown Source) ~[?:?]
at com.fortify.plugin.runtime.bugtracker.internal.BugTrackerLegacyServiceImpl.getBatchBugParameters(BugTrackerLegacyServiceImpl.java:60) ~[?:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleBtAuthenticatedRequest(BugTrackerLegacyMessageHandler.java:124) ~[com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleBtConfiguredRequest(BugTrackerLegacyMessageHandler.java:102) ~[com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleBtRequest(BugTrackerLegacyMessageHandler.java:78) ~[com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleInOutRequest(BugTrackerLegacyMessageHandler.java:66) [com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleInOutRequest(BugTrackerLegacyMessageHandler.java:52) [com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.helpers.ExchangeProcessorRequest.handle(ExchangeProcessorRequest.java:37) [com.fortify.plugin.camel-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.helpers.ExchangeProcessor$AsyncTask.run(ExchangeProcessor.java:123) [com.fortify.plugin.camel-20.1.0.0153.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_221]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_221]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: org.codehaus.jettison.json.JSONException: JSONObject["name"] not found.
at org.codehaus.jettison.json.JSONObject.get(JSONObject.java:407) ~[?:?]
at org.codehaus.jettison.json.JSONObject.getString(JSONObject.java:543) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.deserializeUserAssignable(JiraRestConnector.java:352) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.getUserAssignableSearch(JiraRestConnector.java:342) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.updateFieldsAllowedValues(JiraRestConnector.java:326) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.getCreateIssueMetaIssueTypeFields(JiraRestConnector.java:317) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.updateIssueTypeSpecFields(JiraBatchBugTrackerPlugin.java:443) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.setIssueTypeValuesAndUpdateSpecFields(JiraBatchBugTrackerPlugin.java:674) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.getBugParameters(JiraBatchBugTrackerPlugin.java:223) ~[?:?]
... 18 more

So, we look into the sample source code under the SSC war tomcat sample folder
~\Fortify_20.1.0_Server_WAR_Tomcat\Samples\C:\Packages\Fortify_20.1.0\Fortify_SSC_Server_20.1.0\Fortify_20.1.0_Server_WAR_Tomcat\Samples\BugTrackerPluginJIRA7\src\main\java\com\fortify\pub\bugtracker\plugin\jira\JiraRestConnector.java

and find the following line
String name = value.getString("name");

change it into 
String name = value.getString("accountId");

build it again
gradle clean build

and finally replace the original jar with the new build.

====

the reason of this problem might be the following update from atlassian
https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/

By 29 April 2019, we will remove personal data from the API that is used to identify users, such as username and userKey, and instead use the Atlassian account ID (accountId)

====

Thanks if you read up,
and let us know if you guys have more ideas on this issue.

View solution in original post

4 Replies
Commander Commander
Commander

Nevermind guys,

I should have read the error logs further before.
we've managed to have working plugin build for current JIRA cloud. 

You can find the new plugin jar in the attachment. Just rename the file ext to .jar

==================

For those, who's interested in the issue details, here's what we found:

in plugin-framework.log,
it's saying exactly where the problem is:

2020-08-03T10:02:50,182 | ERROR | pool-10-thread-1 | BugTrackerLegacyMessageHandler | 23 - com.fortify.plugin.camel.bugtracker - 20.1.0.0153 | Error while handling BTGetBatchBugParameters
com.fortify.pub.bugtracker.support.BugTrackerException: Error while setting Jira fields configuration: JSONObject["name"] not found.
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.getBugParameters(JiraBatchBugTrackerPlugin.java:230) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.getBatchBugParameters(JiraBatchBugTrackerPlugin.java:202) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
at com.fortify.plugin.runtime.helpers.BundleUtils$PluginInvocationHandler.invoke(BundleUtils.java:196) ~[?:?]
at com.sun.proxy.$Proxy288.getBatchBugParameters(Unknown Source) ~[?:?]
at com.fortify.plugin.runtime.bugtracker.internal.BugTrackerLegacyServiceImpl.getBatchBugParameters(BugTrackerLegacyServiceImpl.java:60) ~[?:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleBtAuthenticatedRequest(BugTrackerLegacyMessageHandler.java:124) ~[com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleBtConfiguredRequest(BugTrackerLegacyMessageHandler.java:102) ~[com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleBtRequest(BugTrackerLegacyMessageHandler.java:78) ~[com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleInOutRequest(BugTrackerLegacyMessageHandler.java:66) [com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.bugtracker.internal.BugTrackerLegacyMessageHandler.handleInOutRequest(BugTrackerLegacyMessageHandler.java:52) [com.fortify.plugin.camel.bugtracker-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.helpers.ExchangeProcessorRequest.handle(ExchangeProcessorRequest.java:37) [com.fortify.plugin.camel-20.1.0.0153.jar:?]
at com.fortify.plugin.camel.helpers.ExchangeProcessor$AsyncTask.run(ExchangeProcessor.java:123) [com.fortify.plugin.camel-20.1.0.0153.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_221]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_221]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: org.codehaus.jettison.json.JSONException: JSONObject["name"] not found.
at org.codehaus.jettison.json.JSONObject.get(JSONObject.java:407) ~[?:?]
at org.codehaus.jettison.json.JSONObject.getString(JSONObject.java:543) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.deserializeUserAssignable(JiraRestConnector.java:352) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.getUserAssignableSearch(JiraRestConnector.java:342) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.updateFieldsAllowedValues(JiraRestConnector.java:326) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraRestConnector.getCreateIssueMetaIssueTypeFields(JiraRestConnector.java:317) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.updateIssueTypeSpecFields(JiraBatchBugTrackerPlugin.java:443) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.setIssueTypeValuesAndUpdateSpecFields(JiraBatchBugTrackerPlugin.java:674) ~[?:?]
at com.fortify.pub.bugtracker.plugin.jira.JiraBatchBugTrackerPlugin.getBugParameters(JiraBatchBugTrackerPlugin.java:223) ~[?:?]
... 18 more

So, we look into the sample source code under the SSC war tomcat sample folder
~\Fortify_20.1.0_Server_WAR_Tomcat\Samples\C:\Packages\Fortify_20.1.0\Fortify_SSC_Server_20.1.0\Fortify_20.1.0_Server_WAR_Tomcat\Samples\BugTrackerPluginJIRA7\src\main\java\com\fortify\pub\bugtracker\plugin\jira\JiraRestConnector.java

and find the following line
String name = value.getString("name");

change it into 
String name = value.getString("accountId");

build it again
gradle clean build

and finally replace the original jar with the new build.

====

the reason of this problem might be the following update from atlassian
https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/

By 29 April 2019, we will remove personal data from the API that is used to identify users, such as username and userKey, and instead use the Atlassian account ID (accountId)

====

Thanks if you read up,
and let us know if you guys have more ideas on this issue.

View solution in original post

Lieutenant Commander
Lieutenant Commander

Hi, I see similar troubles with Jira Cloud.

I read your explanation, thanks)

As results, I must use my email address in credentials or accountID for you plugin (in BUG TRACKER PLUGIN CONFIGURATION)?

Because I try to use a username like that: **PERSONAL INFORMATION REMOVED** and like that 5e9b01423z90200b957214... and in both situation I see following:

"The test failed. Please check to make sure you have provided the correct URL and credentials. (If proxy is enabled, ensure that the proxy configuration is also correct.)"

 

0 Likes
Commander Commander
Commander

Hi @petrb 

have you tried something like this ?
username : your registered email
password : your api token string

as for the api tokens. I think i got one from here
https://id.atlassian.com/manage-profile/security/api-tokens

i hope this works for you

Regards,
Aji

Lieutenant Commander
Lieutenant Commander

That works for me too! Thanks)

@ebell maybe you could update this plugin in a new release?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.