c# creat portal user


i would like to import our it-emails from user via a windows service directly into jira. so far so good. the windows service is working fine.


from the licence model: jira differenciats between full user (needs a licence) and portal user (free of licence). my problem is that i would like to create via c# protal-user for the user which are reporting a case, but do not have / need a full licence.

i've found in the sdk so far only the class JiraUser. but it creats me "full-licenced-users".


has anyone an idea how to manage this?




br, andre

2 answers

1 accepted

0 votes
Accepted answer

hi @all,

finally i could manage it. my code was fine as well as the data in "theory". json-checker said data was fine. but not for jira.

in the mentioned link to jira-REST-api-customer, jira is presenting an example how json should look like to create a customer:

{"displayName": "string","email": "string","fullName": "string"}

in my IDE i got all the time as an answer to my POST-request "StatusCode: 400, Bad request", but not more.

I heared in a tutorial about the tool POSTMAN, where you can create JSON request to any api. very nice. here i finally got a usable answer >>> "you cannot use displayName and fullName at the same time"

reducing my JSON-data to {"displayName": "string","email": "string"} made my code working.


thanks again to the makers of POSTMAN, you saved my day. :)


br, andre


0 votes
Maarten Cautreels Community Champion May 05, 2017

Hi André,

Luckily you can since they've recently resolved this suggestion: JSDCLOUD-3398.

There's an API especially for this task: https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-customer-post

Hope this helps,


thanks fo you quick answer. i'll try it asap. but i never used REST before. it might get a bit tricky for me. ;)

do you know, if they will implement this functionality also in the .net-sdk


br, andre

hi, i managed it so far to get users via webRequest/JSON. but when i try to create a user, i get always as response "StatusCode:400 - Bad Request". the new user is defenetly not in the database. but the response does not contain a helpful advice. below my relevant c# code - any idea what i#m doing wrong?


br, andre


client.BaseAddress = new Uri(url_BaseAddress);
client.DefaultRequestHeaders.Add("Authorization", " Basic " + base64EncodedCredentials);
client.DefaultRequestHeaders.Add("Accept", "application/json");

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, url_Customer_Create);

jsonStr = JsonConvert.SerializeObject(customer);//json string checked via webtool > is OK

request.Content = new StringContent(jsonStr, Encoding.ASCII, "application/json");

using (HttpResponseMessage response = await client.SendAsync(request))
if (response.IsSuccessStatusCode)
      //some more code...


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,177 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you