How to create an issue in Jira project via C# API? URL is probably wrong

Welcome to the Atlassian developer community @GeneSewell,

As a prior C# developer, I wish there were more .NET examples around the community. Alas, you’ll find a lot more Java and JavaScript here than anything else. That aside, lets try to get your Postman sorted. Anticipating @anon96974232’s reason for asking about Postman, I find the use of a “raw HTTP client” to be helpful, regardless of programming language because it helps me to isolate at least 1 layer of problems (HTTP vs code concepts).

Personally, I use Insomnia and HTTPie instead of the more popular Postman and curl but that shouldn’t prevent us from finding common ground. The first thing to know is that Atlassian’s API Tokens use Basic Auth. So, despite there being a Postman section about API Tokens, just use Basic Auth and use your email for your username and API token for your password. That should populate the Authorization header with something that looks like Basic aWJ1...MUIz.

Then, you want to make sure that you POST to /rest/api/3/issue. For example, here’s my full request URL:

https://devpartisan.atlassian.net/rest/api/3/issue

And the JSON body can get quite picky. Here’s a minimum request, using a project ID and issue type ID that you’ll have to obtain outside this request. For example, by doing a bit of that URL hacking that I explained in my other post.

{
	"fields": {
		"project": {
			"id": "10768"
		},
		"issuetype": {
			"id": "10003"
		},
		"summary": "Summarize the issue"
	}
}

If you want to use the REST API to get some arbitrary IDs for each project and issue type, try these:

  • GET /rest/api/3/project/search?maxResults=1: look for $.values[*].id (to express the path in JSON path). For me, that satisfies the project ID with 10768. Use that value to get the available issue types…
  • GET /rest/api/3/issuetype/project?projectId=10772: look for $.[*].id. For me, one of the issue types is 10003.

Both requests will work without authentication; however, in your Jira instance, there might not be any public projects with issue types, which means you might get 0 results.

I hope that gets you a little further.