Dear
i want to search value in custom field in google
as i found script runner could help me to open link https://scriptrunner.adaptavist.com/latest/jira/fragments/WebItem.html
but how can append my custom filed value at the end of url ??
BR
Xarax
You can't using the "Navigate to link" option. The only variable available are $issue and $jiraHelper.
But if you select "do nothing" and then use a WebResource item and expose your own javascript to bind the new webItem (using the key from your webItem as the id of the DOM element), then you can use javascript to find and extract the custom field value and use that in your javascript event to pass the value to google.
Thanks peter
but i'm beginner and could not write javascript .
could you please help me to write this code ?
BR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JS is not my area of expertise either.
You could try something like this:
AJS.toInit(function () {
var webItemKey = 'key-of-your-web-item';
var customFieldId = 10021;
var customFieldDivId = '#customfield_' + customFieldId + '-val';
var customFieldValue = AJS.$(customFieldDivId).text().trim();
var webItem = AJS.$('#' + webItemKey);
if(webItem){
webItem.attr('href', webItem.attr('href') + '&q=' + customFieldValue);
}
});
With this example, you would continue to use "navigate to a link". All this does, it append the value of your custom field to the URL that you've specified in the webitem.
Just update the webItemKey and customFieldId to your values.
You'll need to save this to file in your [jira-home]/scripts directory and point to it using a "install web resource" fragment. There are some jira setup prerequisite that may require a jira restart (see the link above for details). Then in your install web resource, you need to identify a context for when this js file should be downloaded by the browser so that it's available and runs when the page refreshes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If my answer helped you, I'm glad it did.
To help others find it, can you please click the "Accept Answer" button?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.