Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Trouble serializing request body in .NET

I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 06, 2023

I have a request body that uses an inherited class, but the properties of that class are not being serialized when sent to Jira.

Below is my model, you can see that BuildUpdateFields is inheriting from JiraFields

public record JiraFields
public string Summary { get; set; }

public IssueType IssueType { get; set; }

public Project Project { get; set; }


public record BuildUpdateFields : JiraFields

public string? ProjectId { get; set; }

// validation date (YYYY-MM-DD)
public string? ValidationDate { get; set; }

And below is the implementation:

public async Task<string> CreateBuildUpdateTicket(
BuildUpdateTicketRequest buildUpdateTicketRequest,
CancellationToken cancel
var jiraCreateIssueRequest = new JiraCreateIssueRequest
Fields = new BuildUpdateFields
Summary = buildUpdateTicketRequest.IssueSummary,
IssueType = new IssueType { Id = "10115" },
Project = new Project { Id = "10023" },
ProjectId = buildUpdateTicketRequest.ProjectId,
ValidationDate = buildUpdateTicketRequest.ValidationDate,

var systemTextJson = JsonSerializer.Serialize<object>(jiraCreateIssueRequest);
var newtownSoftJson = JsonConvert.SerializeObject(jiraCreateIssueRequest);

JiraCreateIssueResponse jiraCreateIssueResponse = await _jiraCloudClient.CreateIssue(

return jiraCreateIssueResponse.Id;
catch (Refit.ApiException apiException)
Log.Error("API request failed with status code: " + apiException.StatusCode);

if (apiException.Content != null)
Log.Error("API response content: " + apiException.Content);



You can see I've tried two different serializers. The Newtonsoft one actually does serialize ProjectId and ValidationDate:

{"Fields":{"Summary":"Anaheim, CA","issuetype":{"Id":"10115"},"Project":{"Id":"10023"}}}
{"Fields":{"ProjectId":"1234","ValidationDate":"2023-10-05","Summary":"Anaheim, CA","IssueType":{"Id":"10115"},"Project":{"Id":"10023"}}}

However, then sending newtownSoftJson off to Jira with string type returns 

["No content to map to Object due to end of input"]

I've been trying every iteration I can think of with this. If anybody has any suggestions, I would really appreciate it.

1 answer

1 vote
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 06, 2023

Hi @Colin -- Welcome to the Atlassian Community!

You may want to also post your question in the developer community:

Kind regards,

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events