(Java) Create custom tag

Hi, could you provide a sample if it’s possible to add a custom tag to an instance of NewExternalIssue or attach to an instance of NewAdHocRule and the new issue will inherit tags?
I try to implement the possibility quickly find issues by custom tags

@Julien_HENRY could you assist with this?
If it not possible I will try to add custom Page

Could you please avoid pinging me on every thread. I’m already notified of threads/topics I have some knowledge/interest in.

1 Like

Sorry. Thanks for feedback

There is org.sonar.api.issue.Issue interface which contain tags collection, but I didn’t find how to apply it

image

Hello,

I don’t have the answer to you precise Java/API question but I want to share some thoughts.

I’m surprised you created a plugin to import External Issues whereas there is an API to import them thru a JSON file as described here: https://docs.sonarqube.org/latest/analysis/generic-issue/. You could have same some time here probably.

As you developed a plugin, you’d better import your issues as normal issue to benefit from the status management (Open, Resolve as won’t fix, …).
Also you should know that if your Rules are declared with Tags, these tags will be replicated to the corresponding Issues.

Alex

Hello,

We are having similar requirement.
Is there a way to override tags of an issue (instead of replicating the tags assigned to the rule).
Please suggest.

With Regards,
Vara Prasad.