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.
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}');
}
}That returns a 401 Unauthorized error.
I set Create Issues permission to public and my user has the roles "Administrators", "Service Desk Customers" and " Service Desk Team".
a) Can you give a hint, what I have to change in order to be able to create a service desk issue.
b) If anyone has an idea how to set the user's name and email to the ticket in a way that I can click on the "reply to customer" button in service desk and the reply is send to his address please let me know.
Best,
Stephan