Im developping a plugin that creates a filter from an event. But creating the filters can only be done using the rest api.
Why is there such a great difference between the rest api and the java api?
Atlassian JIRA API: https://docs.atlassian.com/jira/latest/overview-summary.html or JIRA REST API: https://docs.atlassian.com/jira/REST/latest/
Community moderators have prevented the ability to post new answers.
See https://docs.atlassian.com/jira/latest/com/atlassian/jira/bc/filter/SearchRequestService.html. I have an entire recipe for this in the JIRA Development Cookbook and this is the API to use.
Thanks, seems like a very usable example. And a nice book.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Jira API hooks directly into the application, whereas the REST API is external. You can even think of the REST API as being a set of functions that simply relay information between the internal Jira API and the outside world. Same way that the GUI relays information between a browser and the internals of Jira.
The reason there's a great difference is that Atlassian write the internal API to provide the application. REST is just one facet of the interfaces to the outside world, and it requires extra coding in order to talk to the internal API
And, you can create filters in the Jira API, but you have to do it in something that is running inside the app. Like a REST plugin.
(It's actually a great deal more complicated than that, and there's stuff about architecture, interfaces, and structure that I've completely left out, and a good chunk of my explanation is arguably completely wrong - but I'm trying to explain it from the point of view of the layman who might want to tinker with some code)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But I assume that the rest API internally also talks to an API. But that API is I assume internal. And for the public java API I cannot see the correct namespaces or methods I can use to create filters. Am I overlooking something from the API documentation? Or should I look somewhere else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The REST API talks to the Jira API.
The Jira API can create and save filters - that's all the REST stuff asks it to do.
My understanding is that there are things inside Jira that aren't directly publicised in the Jira API, but the only one I've run into is "move issue". Everything else I've tried to write a plugin for has used the Jira API to do what's needed. (I should point out that I am not a prolific developer - I may have 50-60 plugins to my name, but they're mostly small, do one or two specific things for the client at the time and are mostly "copy and tweak the previous version")
I've got some v4.0 code somewhere that builds a query with the JQL builder and saves it as a filter for the user - I seem to remember that once you've built a query, it's a one-line call inthe API to save it, but it has been a while. I'll see if I can dig it out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that sounds good. It would be nice if you can find that example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rats, Jobin beat me to it - SearchRequestservice.createFilter is what my code runs in the end
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.