Running Frappe Functions from help menu

I want to add an option of my client being able to raise a support ticket (enquiry or bug) from their login.

An easy way i can think of is adding this code

new frappe.views.CommunicationComposer({subject: frappe.defaults.get_user_default("Company")+" | Support Ticket | "+ frappe.datetime.nowdate() ,recipients: "support@mycompany.in",message:"Describe your issue or request in detail with screenshots if necessary" ,doc: {doctype: "User",name: frappe.session.user} })

to help help_links.js like this

The Result should be something like this (works from console, the button is added in the help menu as well, but the code inside needs correction.

.

Any pointers? if i can run the above code snippet inside the help_links.js, it would be perfect.

What’s the output you have when adding this in the help_links.js file? I’m assuming the communication composer image is after adding the code in the console.

Not exactly, the output is when i paste the code in console. there is no error in console or the browser.

The trouble is only values for url seem to work, which is not what we want here, we need to run a frappe function.

As of now i edited the db entry for Report an Issue and it is working. Getting this done through help_links is an easier way for many client facing interactions, like, bugs tickets, support, training etc. Also becomes a feature to show case ERPnext’s Support Module in action.

Did you run bench build after making the changes? Try doing so.

Also, since you’re on v13, you can add an option in the navbar settings as well.

tried the bench build, but i am not sure it will not work, the code inside was just a placeholder.

The label shows, but how do i make a frappe function run if i click on it(function also works)?

Also, since you’re on v13, you can add an option in the navbar settings as well.
How?

Figured out adding, options to navbar.

Now the issue is clicking the send button gives the below error

communication.js:607 Uncaught TypeError: Cannot read property 'doctype' of undefined
at init.delete_saved_draft (communication.js:607)
at frappe.ui.Dialog.primary_action (communication.js:23)
at HTMLButtonElement.<anonymous> (dialog.js:149)
at HTMLButtonElement.dispatch (jquery.min.js:3)
at HTMLButtonElement.r.handle (jquery.min.js:3)

https://github.com/frappe/frappe/pull/12814

Hi @walstanb , I am getting a similar error when trying to use

new frappe.views.InteractionComposer({title: "random title"})

interaction.js:200 Uncaught (in promise) TypeError: Cannot read property ‘doc’ of undefined at frappe.views.InteractionComposer.get_values (interaction.js:200) at onchange (interaction.js:57) at base_control.js:175
is this related or an oversight on my end?

This might be an issue at your end.