Dear all,
I have a flutter app deployed to external customers. These customers shall be able to raise a support ticket from within the app. I have the name and email address of the customer and want to use that as reply to - data for the request.
Behind the scene, I am calling
https://my-org-name.atlassian.net/rest/servicedeskapi/request
Future<void> _createJiraTicket({
required String summary,
required String description,
}) async {
final auth = base64Encode(utf8.encode('$_jiraEmail:$_jiraApiToken'));
final body = {
'serviceDeskId': 1,
'requestTypeId': 4,
'requestFieldValues': {
'summary': "summary",
'description': "description",
},
};
final response = await http.post(
Uri.parse(_jiraApiUrl),
headers: {
'Authorization': 'Basic $auth',
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: jsonEncode(body),
);
if (response.statusCode != 201) {
throw Exception('Failed to create Jira ticket: ${response.body}');
}
}
Solved:
I created the API key in https://admin.atlassian.com/o/43382e88-04fa-48eb-aca8-0fa70c76a67c/admin-api
I had to create it in https://id.atlassian.com/manage-profile/security/api-tokens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.