Zendesk - How do we can modify "subject" based on custom filed value (enter by user ) in new request form - zendesk

In my request form, I have custom field orderno. 
I want to concatenate the orderno with subject (that will be Ticket's Title).
Currently I have hide the subject field with jquery script and set some default value.
 
$('.form-field.string.required.request_subject').hide(); //hide subject
$('#request_subject').val('Insurance new request no:');
What I want to achieve is when user submit the request form the order no which is enter by user should be included in subject.
e.g. orderno= 12124 subject should be like "Insurance new request
no:12124"
Is this possible ? or what can be best alternate for this

UPDATE
Answered from ZendkesK Community Moderator here
he trigger condition would be {{custom field}} is present and any other conditions you would need.
The action would be to notify the webhook.
The JSON would be similar to {"ticket": {"subject": "{{ticket.title}} [{{ticket.ticket_field_yourfieldID}}]"}}
I also add a tag and check for the tag to ensure it only fires once.
The webhook would have an endpoint of https://yourdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json
Request method PUT
Request format JSON
We use this method in several situations and it works very well for us

Related

How can i trigger zendesk web widget after page reload?

I create custom ticket form in zendesk and passing some parameters (like customer name, customer email, and customers company name) from my database. then i found zE(identify) functions and saw this functions include just name and email object. but i need customers company names too. and it is just came after completely page reload.
So how can i refresh (or something) after database value completely reload?
sorry for my bad english
To execute zE function after page load you should be able to add it to a callback function from however you are loading the DB values.

Zapier - Zap, How to call an Action on a list one by one

I'm configuring a zap which does the following:
Get a list of emails from an API endpoint.
Subscribe each record to Mailchimp
My problem here is that the subscriber email takes in a list of emails and this returns the following error message:
Bargle. We hit an error creating a subscriber. :-( Error: Invalid
Resource - Please provide a valid email address.
This is because Mailchimp aparently doesn't allow multple subscriptions in one single form.
So my question is, is there a way to perform an action per element in the list ?
Some sort of
emailList.foreach(function(email){
performAction(email);
})
Note that I cannot use the cli, is this possible with some sort of funnel action in zapier or maybe using the scrpting ?
Thanks
David here, from the Zapier Platform team.
By default, when a trigger returns a top-level list of objects, subsequent actions occur for each. I'm not sure what type of trigger you're working with, but make sure it returns an object like this:
return [{email: 'email1#gmail.com'}, {email: 'email2#gmail.com'}, {email: 'email3#gmail.com'}]
and it should work as expected.

web2py pass parameters to controler and download a file

I have the following problem
On my page user can select date from and date to. This dates are to be send to controller on button click, which creates an excel file and user receives that file?
Any suggestions ??
Thank you
def excel_file():
form = SQLFORM.factory(Field('start_date', 'date'),
Field('end_date', 'date'))
if form.process(session=None).accepted:
excel_file = create_excel_file(form.vars.start_date, form.vars.end_date)
return response.stream(excel_file, filename='name_of_file.xlsx',
attachment=True)
return dict(form=form)
Note, the above sets session=None in the call to .process() in order to disable use of the _formkey hidden field (otherwise, you would only be able to submit the form once and would have to manually reload the page for a second submission). This means there is no CSRF protection, but that shouldn't be a problem here, as the form submission is just being used to request data rather than make any changes. If you need CSRF protection, you will have to implement it manually.
Also, note that excel_file can be a file-like object (such as StringIO), an open file object, or a string representing a full file path.
Alternatively, in the browser, you could add an event handler via Javascript to capture the button click and instead of allowing the form to post, call window.open() with a web2py URL that will create and serve the file (you would have to pass the values of the start and end dates from the form via the query string of the URL). You could optionally blank out the form fields after the submission.

Update param and call action in controller on click?

I have been banging my head over this for the past 3 days (No kidding!!!)....It seems like a very simple thing but I am just unable to do it. So I'm putting the question out here, and am open to any method which would work.
BACKGROUND : An advanced search form on submission used to generate an URL too large for the server. So the form had to be submitted via POST. So far, so good. Form submitted successfully, and the result was displayed. Only remaining problem was pagination.
As it's a POST call, it ruled out will pagination. While will-pagination merges param page to the existing params, but the problem is that it shows on url which results in the same error.
QUESTION: So is there any way, if the user clicks a link NEXT, I can
a) Update the page param
b) Keep the existing params
c) While not changing the URL
d) Transfer control back to the action in controller?
The only solution so far suggested was have a hidden form, repopulate it's value and submit again. The form's pretty complex, so if there is a cleaner way I'd like to know.
I see what you want from your comment. So editing my reply accordingly. You want the information as to which column is being selected in the sort to be available to the controller without having that information available in the url string, and you want to use GET for this not POST
The challenge you have is that you want to preserve state between requests and you need a mechanism for doing this. POST preserves that information by sending it in the body of the POST request. GET does this by allowing you to populate the query string. The other method for preserving state is to use a cookie.
You can manipulate the url with javascript on the page. There are tutorials online for that.
But if you just want a simple controller hack as you say in your comment then the simplest one I can think of is to allow the user to make the GET request to the url with the query params in it, then handle this request in two steps - step one saves the query information to the cookie, step two redirects them to the url with that query string data stripped, and you look on the cookie to see if it has those fields before building your data for that page. It's hacky but it works.
def sort
session[:sort] = params[:sort]
redirect_to url_without_the_query_string
end
There is also the new html 5 feature:
window.history.replaceState(“Replace”, “Page Title”, “/mypage”);
from this stackoverflow answer here: How to remove query string from url using javascript
However I'm not sure I'd recommend messing with the url after load like that (I don't know enough about that solution so I'd recommend you read that answer and see if that fits). So, if you MUST lose that data from the url string, because you need to somehow pass it between requests you either have to use POST, or use the session cookie/redirect method I describe above.
Does your html <form> have an action attribute? If not, add one that points to the page.
If you want to preserve the current GET params so that results from the POST can use , you will also need to modify the javascript triggered on the heading links so that as well as (or instead of) modifying the query string, they write the same data to hidden form fields (which of course then get posted in the body of the request). Your JS library may already include helpful functions for that.

Sharepoint 2007 approval email

in our Company we have a Sharepoint 2007 Server which we are using to keep track of our cars.
What I try to achieve is to have a aspx page where you can select a car of the cars list and then click "request". If you did that the page must switch to another text saying something like "car request in progress" (and of course hide this car in the cars list if the next person enters this page) and send an email to someone which contains two buttons: "accept" "decline". If he clicks "decline" the cars status has to be set to available again so someone else can do a request for this car again. if he clicks "accept" another person gets an email telling him that person1 requested this car and this has been approved by person2. this emails are easy to create using workflows which are waiting for the status to change but how can i create a link which changes a cars statusfield in the cars list and what code do i need in the aspx request page?
Thanks in advance!
MemphiZ
Make a link that, when clicked, will run the appropriate action on the users behalf. If you are using workflows, this is as "simple" as changing the items property and letting the item-change event be handled. Make sure to avoid cyclic changes.
This can be done trivially by encoding the items GUID (and perhaps list and action and whatever else you want) in the URL; the GUID can be used with the SharePoint Object Model for the lookup.
Perhaps the above can be done using SPD without a separate/"code" ASPX, but I don't touch that pile of "fun".
Edit for comment:
In my scenario we just encoded the link as http://foo.com/whatever.aspx?id={THEGUID}. The aspx handler just read the query parameters. Item editing ability used standard SharePoint list permissions. Double-submissions were rejected because after the link is handled the item modified to be in a new state which does not accept said link-action (thus clicking the link again simply resulted in no-operations). Working out a total state-diagram before starting work can save lots of time.

Resources