Hi,
I am trying to build a JIRA plugin that will essentially be a REST api that can be called to take some actions like create/edit issues, etc. This is for the Jira server version.
This Rest api will then be called by a backend application with the payload.
Does anyone have any code samples on how to do this. My question is mainly around what JIRA apis to use and how, to get this done. I don't see any tutorials on this on the JIRA site.
Has anyone here done this before? It would be very helpful if you could point me in the right direction, as I am very new to this.
Thanks in advance!
Besides agreeing with @Nic Brough -Adaptavist- here are some tutorials
Using REST API
https://developer.atlassian.com/server/jira/platform/rest-apis/
Creating first plugin
https://developer.atlassian.com/server/framework/atlassian-sdk/create-a-helloworld-plugin-project/
And creating a plugin with REST API
https://developer.atlassian.com/server/framework/atlassian-sdk/developing-a-rest-service-plugin/
Best regards,
Pedro Felgueiras
I agree, I would not need them unless I needed custom behavior, which is my use case as I mentioned in the above response.
Thanks for the links! I have gone through them already and they gave me the basic idea on how to create plugins and also create restful apis using them.
However, none of them provide example on how to use the internal java/jira apis to say create or edit the issues. What are the objects that you need to create and how to get access to them. That's why I wanted to see if anyone here has done anything similar and can help me with that. I did not see any code samples from JIRA on this.
Anything with a code sample would be extremely useful.
Best,
Som
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why would you want to do this?
Jira already has a REST API that can create and edit issues, what is the reason for not using that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The reason is we need custom apis that can perform bulk edits to specific fields only.
The current JIRA REST apis do not expose anything like that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- are you serious? With the same argumentation you would be able to claim that Jira already has REST API and there is no need to develop custom plug-ins. Why would you develop any custom plug-in? Why Atlassian permitted this possibility at all? And what is the reason for not using that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I am serious - the original question was about writing a plugin to provide a REST API that can create and edit issues. Jira already has a REST API that does that. So "why re-invent the wheel" is a serious valid response.
Bulk edits - different story, but not mentioned in the original.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but I disagree with you. If you already started development of a plug-in, then you already have any kind of specific logic that you want to implement for functionality customization. Having custom REST API permits you executing various custom operations in a single HTTP request, which already implements all the logic you need. Otherwise why would you develop REST API at all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm afraid you have misunderstood my comment, as well as the previous discussion.
I'll simplify:
Q: Can I write a REST API so remote systems can create and update Jira issues?
A: Jira already has a REST API that can do that.
I never said anything like you should not create your own, I was just pointing out that the original question is only asking about functions that Jira already has. So there's no need to re-invent them. If the existing functions don't do what you want, then yes, create your own that do.
I don't understand what there is to disagree with there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.