ZenDesk - How to update a field on user/organization update - zendesk

I am trying to figure out how to update a ZenDesk custom field when the user or organization has been updated. I've read through the docs, I've tried everything I can think of... All to no avail... Below is the basics of what I want to do:
When any User or Organization has been updated (there has to be some function running as the record updates every time I blur() from a field) I want to check a custom checkbox that is on the same record. Problem is, I can't find anything that triggers when the record is updated (via a ZAT app).
I tried using organization..changed:function(){}. That worked to set the field, sort of. I tried the following code, which checks the box then immediately unchecks the box??? Any thoughts at all on this? Thanks!
events:{
'organization.last_edited_by.changed':'markOrgSend'
},
markOrgSend:function(e){
var organization=this.organization();
organization.customField("update_checkbox",true);
}
Thanks for any insight into how to catch the update/save action for User/Organization records.

What about something like this?
'ticket.assignee.user.id.changed': 'markOrgSend',
'ticket.organization.id.changed': 'markOrgSend'

Related

What kind of hook can I use if I want to change my custom price on Woocommerce bulk edit page?

I created custom price for WC_Product, put them into WC Bulk Edit Page and want to save changed values to disk.
I have seen class WC_Admin_Post_Types (woocommerce/includes/admin/class-wc-admin-post-types.php) and found there some kind of hooks.
I tried to hook `woocommerce_product_bulk_edit_save', but this trigger does not work (or I did something wrong there).
I did find examples in WWW, but then I shall create and use wp_ajax_{something} and 20-30 lines JS code.
May be exists another way for this - my custom price needs all the same as native WC price - where can I see how they are handled and save?
I was able to connect my custom function to hook `woocommerce_product_bulk_edit_save': this hook run if any of native Bulk Edit Fields will be filled, but I filled my custom field only. All should be fine. Thanks if you read this).

Is it possible to unlink a linked record using the Relay Modern imperative mutation API?

I would like write a mutation updater that unlinks a linked record from another record.
For example, suppose I have the following in my store:
client:root {
user: {__ref: "someid"}
}
I am looking for a way to unlink user and client:root. user is a nullable field. I would like subscribers that are interested in the user field to see it has gone null.
Right now the only way I am seeing to unlink this field is to delete the node from the store. I've tried setting the link to null using setLinkedRecord but that throws an error.
.setLinkedRecored() expects the first argument to be an instance of RecordProxy. Use .setValue() for unlinking nodes, as whitep4nther commented above.
store.getRoot().setValue(undefined, 'user');
I was just fighting with this as well, and after digging through the relay codebase, I decided there isn't an appropriate way to go about this right now. I've opened an issue here.

Umbraco7 - ContentService.SaveAndPublishWithStatus VS ContentService.SendToPublication

I have an application that uses a combination of ContentService.Saved & ContentService.Saving to extend Umbraco to manage content.
I have two websites in one Umbraco installation I am using those methods to keep content up to date in different parts of the tree.
So far I have got everything working the way I wanted to.
Now I want to add a feature that: depending on which Umbraco User is logged in, will either publish the content or simply send it for approval.
So I have changed some lines of code from:
cs.SaveAndPublishWithStatus(savedNode, 0, false)
To this:
cs.SendToPublication(savedNode);
Now the problem that I am finding is that unlike the SaveAndPublishWithStatus() method, the cs.SendToPublication(); doesn't have the option of passing false so that a save event is not raised. So I get into an infinite loop.
When I attach the debugger and manually stop the infinite loop the first time it calls cs.SendToPublication(savedNode); I get exactly the behavior I want.
Any ideas about how I can get round this problem? Is there a different method that I should be using?
You are correct in saying that it currently isn't possible to set raiseEvents to false when sending an item to publication - that's a problem.
I've added that overload in v. 7.6 (http://issues.umbraco.org/issue/U4-9490).
However considering that you need this now, an interim solution could be that you make sure your code is only run once when triggered by the .Saved / .Saving events.
One way to do this would be to check the last saved date (UpdateDate) in your code. If the content was saved within the last second of the current save operation, you know that this is a save event triggered by the save happening in SendToPublication action. Then you also know that the item has already been sent to publication and that this doesn't need to be done again - thereby preventing the endless loop from happening.

How to reset the field value on a custom form field?

I have a custom field in Jira and I want to set the value on the field to match the current user.
This seems as though it should be fairly easy, but it has stumped me. I have trawled for information and have been led to using post functions.
Post functions don't seem to actually pre-set the value of fields on the create issue screen unfortunately? I am able to set a value which appears on the issue once it is created using a post function but I cant seem to find a way to set the value on the form itself.
Is this possible?
There is Default Values for 'Create Issue' screen plugin which seems to be doing exactly what you want.

Saving data and displaying it in a form Rails 4

I have created a call report form with my contact's first name & contact's last name in my scaffold. Although I can clearly see the fields in the form and I can go ahead and edit them, the fields of contact_first_name & contact_last_name are always empty after being saved and returning to my view. I don't know what to do or how to approach this issue.
Any suggestions would be greatly appreciated.
There could be many problems:
contact_first_name or contact_last_name could be misspelled.
in controller they may not be permitted
you might be overriding these fields somewhere
etc etc
Possible solutions or the directions to the solution are:
check database for their existence
check spells
check them in permit list
check the logs
But Code would be helping for both you and answering persons. So please post code with your question.

Resources