guilhemmarchand / TA-jira-service-desk-simple-addon

Atlasian JIRA add-on for Splunk alert actions
11 stars 9 forks source link

reporter field is "Anonymous" even though it is filled in the add-on form #76

Closed gaya-medigate closed 3 years ago

gaya-medigate commented 3 years ago

Hi, I'm trying to use the add-on to create tickets in my service desk board from Splunk. Everything's working great except for the "Reporter" field that even though is filled in the Splunk form, it is not sent to Jira and the field appears as "Anonymous" in the Jira ticket. Can I get some help here? Thank you!

guilhemmarchand commented 3 years ago

Hi,

Can you please turn on the debug mode in the Addon setup page. Then, have an alert triggering, look at the logs (see the shortcut in the nav menu), the logs will show the full JSON payload sent to the Jira API in addition with its answer.

What does it look like? One option could be that the value you enter is not compliant with what Jira would expect

Guilhem

gaya-medigate commented 3 years ago

Hi, I already checked what it looks like, wanted to attach an example Json but for some reason I can't Anyways, looks like the value in the Json is null

guilhemmarchand commented 3 years ago

All right that would explain it then, looks like an error somewhere in the Python code

I will double check ASAP and will produce a new fix release accordingly.

Thanks for pointing this out

guilhemmarchand commented 3 years ago

@gaya-medigate

Please double check, and share a log extract showing the JSON data in debug mode.

I gave it a test, and I can see the following data, in that example I have set the reporter to "splunk_svc": (the connection to JIRA being made with a different user for the verification purposes)

signature="json data for final rest call:={
    "fields": {
        "project": {
            "key": "ACME"
        },
        "summary": "Splunk Alert: Test new JIRA",
        "description": "The alert condition for 'Test new JIRA' was triggered.",
        "issuetype": {
            "name": "Bug"
        },
        "reporter": {
            "name": "splunk_svc"
        },
        "priority": {
            "name": "High"
        }
    }
}

Once the issue has been created in JIRA, I can see the reporter effectively:

image

The issue is as far as I can tell on your side.

Guilhem

gaya-medigate commented 3 years ago

@guilhemmarchand

This is the message on the "Overview - JIRA Service Desk" board - Seems like the reporter is sent correctly but in the Jira board, I still see "anonymous". Is there any specific configurations I need to set up in the Jira itself?

2021-04-19 07:46:07,609 INFO pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="Alert action jira_service_desk started." action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" action_status="success" 2021-04-19 07:46:07,610 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_url=medigate.atlassian.net" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved"

2021-04-19 07:46:07,610 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_username=splunk@medigate.io" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,610 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_ssl_certificate_validation=True" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,610 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="ssl_certificate_validation=False" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,610 INFO pid=28870 tid=MainThread file=setup_util.py:log_info:117 | Customized key can not be found 2021-04-19 07:46:07,610 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_passthrough_mode=0" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,610 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="passthrough_mode=False" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,611 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="Get session_key." action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,719 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="splunkd_port=8089" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 INFO pid=28870 tid=MainThread file=setup_util.py:log_info:117 | Proxy is not enabled! 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="proxy_url=None" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="use_proxy set to False" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_project=MDGT" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_issue_type=New Feature" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduler__admin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_priority=Medium" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_dedup=disabled" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_dedup_exclude_statuses=Done" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_dedup: jira_dedup_full_mode is set to True, the full issue data will be used for the md5 calculation." action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,720 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_attachment=disabled" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_attachment:=disabled" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_attachment_token=/opt/splunk/var/run/splunk/dispatch/scheduler__admin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993/per_result_alert/tmp_0.csv.gz" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_customfields_parsing=" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_customfields_parsing:=enabled" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduler__admin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="event=OrderedDict([('_bkt', 'tricity~29~877F89A5-8716-4B1E-8708-59C6C0EC631D'), ('_cd', '29:1788224'), ('_eventtype_color', ' '), ('_indextime', '1617104405'), ('_raw', '{"username": "medigate", "organization": "tricity", "type": "Make a Feature Request", "feedback_category_id": 2, "feedback_category": "New Feature Suggestion", "text": "test test"}'), ('_serial', '7'), ('_si', 'analytics-splunk.medigate.io\ntricity'), ('_sourcetype', '_json'), ('_subsecond', '.3583682'), ('_time', '1617104405.3583682'), ('_timediff', ' '), ('eventtype', ' '), ('feedback_category', 'New Feature Suggestion'), ('feedback_category_id', '2'), ('first_name', 'Medigate'), ('host', 'prod-beta-web'), ('index', 'tricity'), ('lastname', 'User'), ('linecount', '1'), ('organization', 'tricity'), ('punct', '{"":"","":"","":"","":,"":_"_","":"'), ('reporter', 'test1@medigate.io'), ('serial', ' '), ('source', 'webmed'), ('sourcetype', '_json'), ('splunk_server', 'analytics-splunk.medigate.io'), ('splunk_server_group', ' '), ('tag', ' '), ('tag::eventtype', ' '), ('text', 'test test'), ('timestamp', '2021-03-30 11:40:05'), ('type', 'Make a Feature Request'), ('user_email', 'nan'), ('user_name', 'medigate'), ('username', 'medigate (Medigate User)'), ('mvbkt', ''), ('mvcd', ''), ('mveventtype_color', ''), ('mvindextime', ''), ('mvraw', ''), ('mvserial', ''), ('mvsi', '$analytics-splunk.medigate.io$;$tricity$'), ('mvsourcetype', ''), ('mvsubsecond', ''), ('mvtime', ''), ('mvtimediff', ''), ('__mv_eventtype', ''), ('mv_feedback_category', ''), ('mv_feedback_category_id', ''), ('mv_first_name', ''), ('mv_host', ''), ('mv_index', ''), ('mv_last_name', ''), ('mv_linecount', ''), ('mv_organization', ''), ('__mv_punct', ''), ('mv_reporter', ''), ('mv_serial', ''), ('__mv_source', ''), ('mv_sourcetype', ''), ('mv_splunk_server', ''), ('mv_splunk_server_group', ''), ('mv_tag', ''), ('__mv_tag::eventtype', ''), ('mv_text', ''), ('mv_timestamp', ''), ('__mv_type', ''), ('mv_user_email', ''), ('mv_user_name', ''), ('mv_username', ''), ('rid', '0')])" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_priority_dynamic=" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,721 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_summary=Make a Feature Request [1617104405.3583682]" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,722 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_description=test test" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,722 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_assignee=" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,722 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_reporter=test1@medigate.io" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,722 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_labels=tricity" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,722 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_components=" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,722 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_customfields_parsing=enabled" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduler__admin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,724 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_customfields=" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,724 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="json raw data for final rest call before json.loads:={ "fields": { "project": { "key": "MDGT" }, "summary": "Make a Feature Request [1617104405.3583682]", "description": "test test", "issuetype": { "name": "New Feature" }, "reporter" : { "name": "test1@medigate.io" }, "priority" : { "name": "Medium" }, "labels" : [ "tricity" ] } }" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,724 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_md5sum:=97fc487df544cc317840e9af2e16cbe2" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,724 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="json data for final rest call:={ "fields": { "project": { "key": "MDGT" }, "summary": "Make a Feature Request [1617104405.3583682]", "description": "test test", "issuetype": { "name": "New Feature" }, "reporter": { "name": "test1@medigate.io" }, "priority": { "name": "Medium" }, "labels": [ "tricity" ] } }" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduler__admin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,724 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_dedup:=disabled" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,730 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="response status_code:=404" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:07,730 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_dedup: The calculated md5 hash for this issue creation request (97fc487df544cc317840e9af2e16cbe2) was not found in the backlog collection, a new issue will be created" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:09,115 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="response status_code:=201" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:09,115 INFO pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="JIRA Service Desk ticket successfully created. https://medigate.atlassian.net/rest/api/2/issue, content={"id":"27908","key":"MDGT-633","self":"https://medigate.atlassian.net/rest/api/2/issue/27908"}" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" action_status="success" 2021-04-19 07:46:09,115 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="jira_creation_response_json:={'id': '27908', 'key': 'MDGT-633', 'self': 'https://medigate.atlassian.net/rest/api/2/issue/27908'}" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:09,115 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="record={"_key": "97fc487df544cc317840e9af2e16cbe2", "jira_md5": "97fc487df544cc317840e9af2e16cbe2", "ctime": "1618818369.115627", "mtime": "1618818369.1156313", "status": "created", "jira_id": "27908", "jira_key": "MDGT-633", "jira_self": "https://medigate.atlassian.net/rest/api/2/issue/27908"}" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWwRMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved" 2021-04-19 07:46:09,132 DEBUG pid=28870 tid=MainThread file=cim_actions.py:message:424 | sendmodaction - worker="analytics-splunk.medigate.io" signature="JIRA issue successfully added to the backlog collection. content={"_key":"97fc487df544cc317840e9af2e16cbe2"}" action_name="jira_service_desk" search_name="Jira - TAM - Feature Requests Clone" sid="scheduleradmin_bWVkaWdhdGVfaW50ZXJuYWw__RMD53559449122bcc694_at_1618818360_23993" rid="0" app="medigate_internal" user="admin" digest_mode="0" action_mode="saved"

guilhemmarchand commented 3 years ago

Hi @gaya-medigate

My guess would be that "test1@medigate.io" needs to be a real user registered in your JIRA instance.

Guilhem

gaya-medigate commented 3 years ago

@guilhemmarchand

That was my initial thought as well, but if I try to create a manual ticket, I can use any email address I want and it works fine. And if I try to use a real registered email (my email for example), the result is the same - Anonymous. The user you listed as a reporter in your ticket is registered to your board? can you try it with an unregistered user?

guilhemmarchand commented 3 years ago

@gaya-medigate

My lab isn't up at the moment but I will give it a check later on, and yes it was a true registered user but different from the one used for the connection from Splunk to JIRA.

What you can do, is attempting to create a JIRA issue manually in a rest call with curl, example:

curl \
   -D- \
   -u username:'password' \
   -X POST \
   --data '
{
    "fields": {
       "project":
       {
          "key": "SC"
       },
       "summary": "No REST for the Wicked.",
       "description": "Creating of an issue using IDs for projects and issue types using the REST API",
       "issuetype": {
          "name": "Incident"
       },
       "priority": {
          "name": "High"
       }
   }
}' \
   -H "Content-Type: application/json" \
   https://myjira.com/rest/api/2/issue

Take the JSON data that is generated by the Addon, and perform you own tests until you can the expected results.

Some quick Google seaches:

https://community.developer.atlassian.com/t/proper-way-to-set-reporter-system-field-via-create-rest-api/41399

https://community.atlassian.com/t5/Jira-Service-Management/How-do-I-set-the-reporter-for-an-issue-through-the-rest-api/qaq-p/828162

gaya-medigate commented 3 years ago

Hi @guilhemmarchand I am still unable to resolve this issue. In the example you sent me here - https://github.com/guilhemmarchand/TA-jira-service-desk-simple-addon/issues/76#issuecomment-822039584 Did you use the form from the add-on? or did you send it manually? Can I see the raw JSON Splunk creates so I can make sure that the user email is sent correctly? (when I watch the JSON on rest API the reporter field is empty

guilhemmarchand commented 3 years ago

Hi @gaya-medigate

In https://github.com/guilhemmarchand/TA-jira-service-desk-simple-addon/issues/76#issuecomment-822039584 I have set the reporter in alert action and the Addon form yes. Then I extracted the JSON payload from Splunk logs.

To achieve this, as I mentioned earlier, enable the debug logging in the Configuration page in the Addon in Splunk Web, then have an alert triggering.

The logs, which you can access with shortcuts via the nav menu, will come up with the full JSON payload that is sent to JIRA. Therefore you will see how is translated the form config into a JSON file.

guilhemmarchand commented 3 years ago

Any update @gaya-medigate ?

gaya-medigate commented 3 years ago

@guilhemmarchand so sorry for the delay! I just enabled the logging option, this is the payload I see, and below there's an error message -

"fields": { "project": { "key": "MDGT" }, "summary": "Make a Feature Request [1617104405.3583682]", "description": "test test", "issuetype": { "name": "New Feature" }, "reporter": { "name": "gaya@medigate.io" }, "priority": { "name": "Medium" }, "labels": [ "tricity" ] }

"errors":{"reporter":"Field 'reporter' cannot be set. It is not on the appropriate screen, or unknown."}}"

guilhemmarchand commented 3 years ago

@gaya-medigate

"Is not on the appropriate screen" is returned by Jira, this means your issue is a configuration issue on the screen of the project in Jira, where you need the admin to allow the reporter field to be set.

In short, this confirms the issue is on the Jira side, review with your Jira admins.

gaya-medigate commented 3 years ago

@guilhemmarchand What user is Splunk running the rest request as? could this be a permissions issue? Because I checked with the admin and we do see the reporter field on the screen.

guilhemmarchand commented 3 years ago

@gaya-medigate

The query to Jira is made under the account you configured in the Addon. The fact that Jira API returns this message proves that the problem stands on your side. This means the project does not allow this field to be set with the capabilities the user has.

Review the messages in this chat, I gave you clear examples of curl tests you can use to prove it, use the same credentials that you configure in the Addon and you will get the same message.