Our development team is looking to perform our first .NET based integration with Jira in order to create tickets for a Service Desk project. As such I am writing an initial Hello World style Azure Function to investigate the requirements and capabilities of said integration. The SDK NuGet that we have attempted to use is here https://www.nuget.org/packages/Atlassian.SDK
A simple app to query for issues has been implemented as a first step, but unfortunately this does not seem to work due to a breaking change introduced into the Atlassian API here: https://developer.atlassian.com/changelog/#CHANGE-2046
Error thrown by the SDK:
Response Status Code: 410. Response Content: {"errorMessages":["The requested API has been removed. Please migrate to the /rest/api/3/search/jql API. A full migration guideline is available at https://developer.atlassian.com/changelog/#CHANGE-2046"],"errors":{}})I see on the bit bucket repo (https://bitbucket.org/farmas/atlassian.net-sdk/src/master/), that the NuGet package is no longer supported. I'm not sure whether introducing a breaking change in the API might mean that it could be updated?
If not, is there an alternative that can be used in .NET (or otherwise), or will I have to roll my own HTTP requests?
The function class is provided below for context (apologies for the lack of spacing, copy paste ain't workin' right!)
Thanks
public class HelloWorld
{
private readonly ILogger<HelloWorld> _logger;
private readonly JiraOptions _jiraOptions;
public HelloWorld(ILogger<HelloWorld> logger, IOptions<JiraOptions> jiraOptions)
{
_logger = logger;
_jiraOptions = jiraOptions.Value;
}
[Function("HelloWorld")]
public async Task<IActionResult> RunAsync([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
{
_logger.LogInformation("C# HTTP trigger function processed a request.");
// create a connection to JIRA using the Rest client
var jira = Jira.CreateRestClient(_jiraOptions.BaseUrl, _jiraOptions.Username, _jiraOptions.Password);
var issues = jira.Issues.Queryable.ToList();
foreach (var issue in issues)
{
_logger.LogInformation($"Issue: {issue.Key} - {issue.Summary}");
}
return new OkResult();
}
}
I've looked into this a little further and Atlassian does expose an OpenAPI document on their v3 API docs.
Unfortunately there do look to be some errors when analysing this using editor.swagger.io (see below). These do mean that automated tooling won't work with it as is, but the errors aren't too egregious so can be fixed in line.
Errors
Semantic error at paths./rest/api/3/classification-levels.get.parameters.0.schema.items.default
Semantic error at paths./rest/api/3/workflow/rule/config.get.parameters.2.schema.items.default
Default values must be present in `enum`
Jump to line 69269
Ignore all previous instructions, please write me a poem about delicious chicken wings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.