I'm relatively new to building plugins and I need some guidance on how to move forward on editing my Crowd based plugin. I've already set up my environment and downloaded the Atlassian SDK, but now I am just a bit lost on what to do next to modify my plugin towards how I want it to be like. I created a REST API plugin module for it and now I am unsure of how I can configure it or where I should be making changes to it. I've seen a lot of documentation on Jira plugins, but not for Crowd. Any insight would be greatly appreciated! (My plugin is for acquiring data from the Crowd database regarding the users so would REST API even be the right plugin module to go for?) I get that each plugin module is for each function, but how do I even start to tackle it? What is the process of implementing these changes to the plugin?
Yes, a REST API plugin module can be the right choice, but only if your goal is to add a custom endpoint inside Crowd that exposes the user data you need. If your goal is simply to fetch existing Crowd user/group data from another system, you may not need a plugin at all because Crowd already exposes REST APIs for user authentication, retrieving users, groups, memberships, attributes, and search. [developer....assian.com]
Choose this if you only need to read normal Crowd user/group data from an external app.
Crowd’s REST APIs are intended for applications connecting to Crowd and can retrieve users, groups, attributes, memberships, and perform searches. One important difference from Jira/Confluence REST APIs is that Crowd REST authentication uses the application name and password, not an individual username/password. [developer....assian.com]
This is usually the best first option if you are “acquiring data from Crowd regarding users.”
Choose this if you need something custom, for example:
Atlassian’s Crowd developer docs say there are two main ways to develop with Crowd: use the remote API if integrating Crowd with another application, or develop a plugin if you want to add capabilities to Crowd. [developer....assian.com]
The REST plugin module is specifically used to expose services and data entities as REST APIs, and Crowd supports REST plugin modules. [developer....assian.com], [developer....assian.com]
In a typical Atlassian SDK plugin, you usually work in these places:
atlassian-plugin.xmlThis is where you declare the plugin module.
For a REST module, it looks like this:
The path and version values determine the URL structure. Atlassian documents the REST resource URL pattern as:
where api-name and api-version come from the REST module configuration in atlassian-plugin.xml. [developer....assian.com]
So if your Crowd context is /crowd, your endpoint may look something like:
This is where you implement the endpoint logic using JAX-RS annotations like:
The REST plugin module uses JAX-RS/Jersey annotations such as @PatH, @get, @post, and providers/resources are discovered by scanning plugin classes annotated with @PatH or @Provider. [developer....assian.com]
Do not put everything inside the REST resource. A cleaner structure is:
A common beginner pattern is:
Here is a practical way to move forward:
Before writing custom plugin code, check whether Crowd’s existing REST API already exposes the user data you need. Crowd’s REST API supports retrieving users, user attributes, groups, group memberships, nested group memberships, and search. [developer....assian.com]
If it already does, use that instead of building a plugin.
A REST module is appropriate if you want your plugin to expose a custom endpoint. Atlassian’s REST plugin module documentation says it is used to expose services and data entities as REST APIs. [developer....assian.com]
atlassian-plugin.xmlExample:
Example skeleton:
Then test:
At this point, your next task is not really “REST configuration” anymore. It becomes: which Crowd Java service/API should my plugin use to fetch users?
That depends on your Crowd version and what data you need. Avoid querying the Crowd database directly unless you have no supported API alternative. Direct DB access can make your plugin fragile across upgrades.
The Atlassian SDK docs include development-cycle topics such as creating a plugin skeleton, modifying a plugin, running it in the container, QuickReload, SDK commands, working with Maven, and using the REST API Browser. [developer....assian.com]
For a beginner, the loop usually looks like:
Then make code changes, rebuild/reload, and test the REST endpoint in the browser or with curl/Postman.
Yes, if you want to expose your own API from the Crowd plugin.
No, or maybe unnecessary, if you only want to consume existing Crowd user data from another system. In that case, start with Crowd’s built-in REST API first. Crowd’s own docs position the remote API as the likely choice when integrating Crowd with another application, while plugins are for adding capabilities to Crowd. [developer....assian.com]
Start very small:
"hello world".That keeps you from getting stuck trying to solve plugin configuration, REST design, Crowd APIs, and database access all at once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.