Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rest API + better ticket description #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jan-zajic
Copy link

  • I refactor code, so used jira api is plugable (you can choose new REST api in global configuration, SOAP is default one) (sonar.jira.rest property).
  • I improved the jira ticket description so it contains line number and class where problem occured.
  • New option to add label to created jira ticket (label name configured using sonar.jira.issue.sonar.label property).

@jan-zajic
Copy link
Author

And i fix bug with issue url in jira ticket description, which don't link to issue in new sonarsource versions.

@Sam-Mumm
Copy link

How can I use your Plugin for me it looks like he try to use still the soap-Interface, because always I run sonar-runner on the CLI I get the error:
Caused by: Impossible to connect to the JIRA server (https://example.com/jira//rpc/soap/jirasoapservice-v2).
Although I set the parameter "Use rest api" to "true" in the Web-Interface. Can you please help?

@jan-zajic
Copy link
Author

@SamMumm i first use Jira api only for JiraIssueCreator, as we don't use JiraSensor functionality, but i fix it for you. Please can you try it again? Unfortunately, I can't currently test it ..

@Sam-Mumm
Copy link

@jan-zajic first of all I would like to say thank you for your quick response. But i am sorry the execution of sunner-runner failed without any error the last lines it shows is
09:18:51.023 INFO - Sensor JIRA issues sensor
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------

Additional I would like to ask how can i use the JiraIssueCreator? If I try to link a Issue in sonarqube with jira I only get a pop-up with the message: "error". Do you maybe know how I can increase the loglevel of the plugin?

@Sam-Mumm
Copy link

ok the second point now works for me it just was a misconfiguration in my sonarqube-Installation

@123dev
Copy link

123dev commented Jan 28, 2016

Thanks for the fix, it really helps.
I had to set the component id, leaving it blank generates the error
"The JIRA property sonar.jira.issue.component.id" must be defined before you can use the Link to Jira button."

I set it to 1 just to get around the error, which created a Jira ticket with no Component Value set.
For the life of me I couldn't figure out how to get the component id
Hovering over the component and checking the url shows a string not an id, and the plugin is expecting an integer.

Any way to make the plugin assign the Jira ticket to the person assigned in Sonar?
I would assume that the usernames must match for it to even be able to do so.
Perhaps a user mapping section would solve that.

Lastly, is it possible to bulk Link to Jira tickets.
Ideally it would be best if the bulk is linked to the same ticket (group of same class issue)
but even a new ticket per would be good.
Linking to Jira one ticket at a time is laborious.

Thanks again for the plugin and the fix.

Map<String, Integer> issuesByPriority = collectIssuesByPriority(service, authToken, filter);
private JiraSession getSession() throws MalformedURLException {
if(isUseRestApi())
return new JiraRestSession(new URL(getServerUrl() + "/rpc/soap/jirasoapservice-v2"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have swapped the REST and SOAP URLs. It should be:

if(isUseRestApi())
    return new JiraRestSession(new URL(getServerUrl() + "/"));
else
    return new JiraSoapSession(new URL(getServerUrl() + "/rpc/soap/jirasoapservice-v2"));

@jan-zajic
Copy link
Author

@jascha you're right, i fixed it. Thanks for your attention.

@justsomebody42
Copy link

Hi, is the jira plugin still maintained?
Will this ever get merged?
And is there a .jar file somewhere that includes this fix?
Thanks for your work on this!!

@ghost
Copy link

ghost commented Sep 14, 2016

Hi everyone.
My understanding of :

makes me think that their is a deliberate wish not to merge this fix. The idea is to do continuous quality checks more than remediation plans (that's mainy what we want to achive when linking in Jira).

However Bellingard gives a tip at the end of his blog post to establish smtg that could be similar :

The good thing is that SonarQube already has everything you need to clearly identify all those
issues and plan a task to make sure they got fixed – whatever task management system you’re using

  • In the SonarQube UI:
    • Start tagging issues you want to fix with a dedicated and specific tag, like “must-fix-for-v5.2″
    • Create a public “issue filter” that displays only issues tagged with “must-fix-for-v5.2″
  • In your task management system:
    • Create a ticket in which you reference the URL of the issue filter
    • Set a due date or a version

You’re done! You have a remediation plan that you can manage like any other task and your team won’t forget to address those issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants