Azure DevOps Extensions Copying value of one field to another field - javascript

I am trying to create Azure DevOps extension where, I want to copy(assign) value of one field to another field when the System.State is "todo". Is there a way this can by achieved using onFieldChanged event in Azure DevOps?
As shown in the image attached, I want to display the text written in System.Title in System.Description using onChange event. Is it achievable using extension?
I followed Microsoft documentation on creating simple extension using html, JavaScript, vss-extension.json. Couldn't find how the events and fields works in extensions.

We recommend that you use custom rule to copy value of one field to another field when the System.State is To Do.
Sample and result:
Update1
We can create extension to copy value of one field to another field. We can use onFieldChanged to get the field value and copy the value to another field. Here is an sample to get work item detail via the event onFieldChanged, please check it.

Related

JavaScript Autofill Issues

I am attempting to create a simple chrome extension autofill for Stripe Checkout pages. Chromes default autofill functions like expected however when trying to use my extensions autofill code to input values into the forms like so
document.getElementById("ID").value = "value"
the value is input initially but will be automatically removed for any number of reasons, like clicking outside of the input or anywhere else on the page will have the value of the input removed. I have tried a few different things like firing all of the necessary events for keyboard input like keyup,keydown,input, change ect and I can not get the value to stick.
I believe that stripe is using some JS to check whether or not the events sent to the input were trusted and if not it is removing the values. for this reason I have attempted to use Chromes Debugger API to send commands directly to the browser. I have found a command that seems like it will work for what I need. The "Input.dispatchKeyEvent" command appears to be what I need but I do not see a way to specify what element the keys are being sent to.
chrome.debugger.sendCommand({tabId:TAB_ID}, "Input.dispatchKeyEvent",{type:"char"})
How Can I Prevent The Values From Being Removed?
Is There A Way To Send trusted key Events To A Specific Element On The Page Using The Debugger?
An Example Of A Stripe Checkout Page Can Be Found Here Click Pay Now To Be Brought To A Testing Page
https://demo.wpsimplepay.com/stripe-checkout/
Command Docs
https://chromedevtools.github.io/devtools-protocol/1-3/Input/#method-dispatchKeyEvent
I don't think is something you'll be able to do, as I'd expect Stripe would want to avoid auto-filling of card details from anything other than the browser or a trusted application.

Disable Single-Select query drop drown based on value in the list-JasperServer

We are using JasperReports Server Community Edition 5.5 and have a problem with a Single-Select Query.
I have a custom need to disable the input drop down if we have the one vale in the drop down and if the drop down is having multiple value then it has to a drop down to select from the listed value.
Could you please how I can achive the same using the jasper or Java code.
Inorder to enable or disable the input controls based on the count of values in it, you need to approach the help of JSP in Jasper Server system.
The main approach is to
Create an another input control which counts the number of values.
Then using JSP, enable or disable the input control based on the
count.
Then finally specify that jsp as optional jsp location in report settings of Jasper Server. Refer highlighted portion in the below image
If you are using pop-up input control then you can find the JSP file in location <js-webapp>/WEB-INF/jsp/modules/inputControls/DefaultParametersForm.jsp.
If you are using In-Page, then location is <js-webapp>/WEB-INF/jsp/templates/inputControls.jsp.
Make a copy of the jsp file to another location say <js-webapp>/WEB-INF/jsp/custom file.
You can refer this blog which hides the input control .
You can make use of it and modify according to your need.
Hope this should help you out.

Force / inform angularJS that the model has updated after we update separate fields from safari extension

I'm building a Safari extension that will auto complete a bunch of fields found on an online form.
That online form is using angularJS to tie in the value in the fields with the value in a model. I don't know much about angularJS, but I could deduce that from the ng-model=user.firstname.value etc. directives found in the input tags.
My Safari extension will get the first name input field, and set firstNameField.val("A first name") in order to add a value in that field.
However, this doesn't seem to update the angularJS model, since if I am to exit that field manually, it'll color itself red, saying there is no data, even though there clearly is some text.
From my extension, I don't seem to be able to access the angular object unfortunately, so I cannot call the methods that I read need to be called (angular.$apply).
Seems like what I am trying to do is doable, since the LastPass extension correctly adds values to the input fields and causes the model to be correctly updated – the fields don't color themselves red.

Address Auto complete using Google Maps API

I am currently using google maps api to suggest addresses as user types into an input field. When they select one of the drop down suggestions provided by google, the state/province gets automatically updated.
I was wondering if there was a way to update the state/province without selecting the suggestions google provides? Maybe a user neglects to select a provided option, how do you then automatically update the state/province
example - https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
Since the data is stored in google's database,I don't think you can update automatically if you don't click on an element of the list, because if you don't click, the google object is not created.
You can still try to convert the value of your input text into a google object but i don't think it's possible (if it is not a google.maps.places.Autocomplete object you can't use getPlace() ).
I tried it already because i was facing the same problem and din't find a solution either, maybe you will manage to convert the input into a google.maps.places.Autocomplete object. It's the only way if you want to use the data of google.

Transferring excel data into text fields and buttons on a webpage

I want to transfer my text data (From Excel) into a form and submit it. It takes lot of time to perform this operation.
So I'm looking into automation tool which can do this task for me.
Basically this webpage consists of Text fields and button.
Is there any way to fill the text field and click on button, by using the Tag name of text field and button from excel?
Is this for yourself or for deployment to the web?
If it's for yourself, you could save the excel file as a CSV. You should then be able to find a way to process it into something that JS can understand.
Actually setting the value of a text element is simply done by targeting the element and setting its value=someValue. For example, you could do
var t = document.getElementById("firstTextField")
t.value = "someValue"
You could also use jQuery for that sort of thing.
You don't really need to use the browser at all. The browser and Excel are just UI on top of the underlying data and API definition, you can script this out. The general idea:
Inspect the form you're trying to submit. Find the target, the submit method, and the field names.
Export the excel file to a CSV.
Write a simple script to loop through each record and make an http request that corresponds with the form submission - same HTTP method, same target URL, putting the Excel values in under the appropriate input names.
It's hard to be more specific with the information you've provided.

Categories

Resources