So, 2 years ago I wrote a program in C# (command based) which created filters through the Jira API's using a POST-call to the API. I got everything working and created around 200 filters using this method.
Now to my problem, I manage to loose the code and program when my laptop crashed and unfortunately I did not have a backup of the code. (stupid, I know).
Now when I try to do the same thing again (using a more fancy WinForm application in visual studio with C#) I can't remember how I did it. I'm pretty sure I worked with a string containing the JQL, something like <jira url>/rest/api/2/filter/?jql=project%20%3D%20SWE" (or something similar. (SWE is the project key in Jira).
Does anyone have a good example of C# and creating filter? Any ideas which way to go, using a HttpClient or HttpWebRequest or something?
I have tried those and get a lot of 400 or 415 issues as a response.
Kind regards, J
Dear @Johan Hallin
<jira url>/rest/api/2/filter/?jql=project%20%3D%20SWE"
This looks more like a GET filter then a POST for creating one.
It just simple. You need to perform a POST to
<jira url>/rest/api/2/filter
with following JSON payload:
{
"name": "My API created filter",
"description": "some more details",
"jql": "project = SWE",
"favourite": false,
"editable": true
}
So long
Thomas
Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.
Register here ⬇️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.