I've created a dashboard to monitor errors & warnings for my app.
I'm logging to separate locations (_sourceHost) based on environment (uat, prod).
I'd like to have a toggle on the dashboard so I can easily switch between UAT & Prod, rather than having to maintain two dashboards.
I'd tried adding a filter but the best I could achieve was a textbox where I enter the _sourceost...
Any ideas?
You could probably achieve this with a search template. Basically, set up a parameter that's the value of the _sourceHost:
_sourceHost={{source_host}}
| the rest of your query here...
Then in the "manage parameter settings" dialog, you could "Set Values for Parameter" to your environment key/value mapping.
Then when you add it to the dashboard it should treat that parameter as a filter, and I believe the values you set up will dropdown from the filter to be selected.
Related
I have certain build parameters followed by active choices(radio button, drop-down etc)
Once after selecting each option I want to display all the selected items as comma-separated value with a box (It's just a confirmation box having all the selected values after which I must proceed to build)
[Build parameters]
https://i.stack.imgur.com/vJjCz.png
[Expected]
https://i.stack.imgur.com/gkJXd.png
You can use the Active Choices Reactive Reference Parameter to active this.
Add Reactive Reference Parameter to you job, call it Test Data, in the Referenced parameters section reference your existing parameters OperatingSystem,OSVersion,TestSuites,ProbeDeploymentType, in the Choice Type choose Formatted Html so you can customise you display box, and in the script section just create the format you want to print and design the HTML for it.
Here is an example with a textarea:
summeryList =TestSuites.split(',').collect { suite ->
"${OperatingSystem}, ${OSVersion}, ${suite}, ${ProbeDeploymentType}"
}
return "<textarea cols='50' readonly name='value' >${summeryList.join('\n')}</textarea>"
You can of course customize the html layout however you want.
Here is a screenshot of the parameter config:
and the result build page:
I'm on a project in which I need to get data from a ServiceNow instance and treat all data with PowerBI. I'm able to retrieve a big amount of data (Snow collect a lot of data), but I still need a way to filter data correctly. I'm calling to this URL:
Besides, I want also to apply a filter to retrieve just some specific registries from the table Requested Items. For that, I use the sysparm_query parameter to filter the field "cmdb_ci" and more specifically it's "name", something like:
&sysparm_query=cmdb_ci=What I need to Filter
Apart from this, I have also tried:
&sysparm_query=cmdb_ci.value=What I need to Filter
&sysparm_query=cmdb_ci.display_value=What I need to Filter
&sysparm_query=cmdb_ci.sys_id=What I need to Filter
&sysparm_query=cmdb_ci.name=What I need to Filter
But still not found the solution... as all these does not respond the solution needed.
Does someone know how I can manage this?
Thanks!!
JLG
There are two "Configuration item" fields in sc_req_item: cmdb_ci and configuration_item. Make sure that you are using the correct one. Either cmdb_ci.name=value or configuration_item.name=value should work, depending on which of the two fields you are using. cmdb_ci.value and cmdb_ci.display_value will not work as there are no fields on the record with these names. cmdb_ci.sys_id should work if you are supplying a sys_id (although it is redundant to type .sys_id for a reference field).
You should first verify your query through the ServiceNow UI before attempting to use it in an API call.
Type sc_req_item.list in the Filter navigator
On the filter list select "Show related fields"
Get your filter to work correctly
Right-click on the filter and select "Copy query"
The next step is to test it using the REST API Explorer.
Final step is to configure your client tool (PowerBI).
I am using Grafana to display data from InfluxDB datasource. I am confused, is there way send "unique id" or another string parameter between dashboards in Grafana? It means when we click on any element on one dashboard, keep parameter of clicked item and go to another dashboard, where we can insert parameter from previous dashboard to query on new dashboard?
current dashboard -> click -> saved item parameter -> go to new dashboard -> use saved parameter to create query for new dashboard ?
I was looking similar solution on http://docs.grafana.org/ , http://play.grafana.org/ and other sites but didn't find the answer
Thank you
Have you tried Drilldown/detail link?
Drilldown / detail link
The drilldown section allows adding dynamic links to the panel that can link to other dashboards or URLs
Each link has a title, a type and params. A link can be either a dashboard or absolute links. If it is a dashboard links, the dashboard value must be the name of a dashboard. If it's an absolute link, the URL is the URL to link.
params allows adding additional URL params to the links. The format is the name=value with multiple params separate by &. Template variables can be added as values using $myvar.
When linking to another dashboard that uses template variables, you can use var-myvar=value to populate the template variable to a desired value from the link.
Link to docs page
Let's say I have two(or more) types of projects: app(Application) and svc (Service) and I have created a Jenkins job (common job) which have bunch of parameters. This common job might call another downstream/individual project type jobs (Trigger other project builds etc and pass respective parameters) but it's out of scope of this question.
For ex:
PROJ_TYPE (a choice parameter type with values: app, svc)
Param2 (of some type)
Param3 (of Cascading type i.e. it depends upon the value of parent parameter PROJ_TYPE).
Param4 (Lets say I want to show this parameter only when PROJ_TYPE is selected as "app")
Param5 (of some type)
Param6 (Lets say I want to show this parameter only when PROJ_TYPE is selected as "svc". This parameter can be of any type i.e. choice, dynamic, extended choice, etc )
If I have the above parameters in a Jenkins job, then Jenkins job will show / prompt all of the parameters when a user will try to build (i.e. Build with Parameters).
Is it possible in Jenkins to show parameter (Param4) only if PROJ_TYPE parameter was selected as app otherwise, I don't want to show this parameter at all -or somehow if it's possible to grey it out? i.e. in this case, the job will show only PROJ_TYPE, Param2, Param3, Param4 and Param5 (and will not show Param6 or it's disabled/greyed out).
Similarly, I want to show parameter (Param6) only if PROJ_TYPE parameter was selected as svc otherwise, I don't want to show this parameter at all -or somehow if it's possible to grey it out? i.e. in this case, the job will show only PROJ_TYPE, Param2, Param3, Param5 and Param6 (and will not show Param4 or it's disabled/greyed out).
I know this is an oldie, but I had been searching for something similar until I found Active Choices Plugin. It doesn't hide the parameters, but it's possible to write a Groovy script (either directly in the Active Choices Parameter or in Scriptler) to return different values. For example:
Groovy
if (MY_PARAM.equals("Foo")) {return ['NOT APPLICABLE']}
else if (MY_PARAM.equals("Bar")) {return ['This is the only choice']}
else if (MY_PARAM.equals("Baz")) {return ['Bazoo', 'Bazar', 'Bazinga']}
/Groovy
In this example MY_PARAM is a parameter in the Jenkins job. As long as you put 'MY_PARAM' in the Active Choices 'Referenced Parameters' field the script will re-evaluate the parameter any time it is changed and display the return value (or list of values) which match.
In this way, you can return a different list of choices (including a list of one or even zero choices) depending on the previous selections, but I haven't found a way to prevent the Parameter from appearing on the parameters page. It's possible for multiple Active Choice Parameters to reference the same Parameter, so the instant someone selects "App" or "Svc" all the irrelevant parameters will switch to 'Not Applicable' or whatever suits you. I have played with some HTML text color as well, but don't have code samples at hand to share.
Dirk
According to the description you may do this with Dynamic-Jenkins-Parameter plugin:
A Jenkins parameter plugin that allows for two select elements. The second select populates values depending upon the selection made for the first select.
Example provided on the wiki does exactly what you need (at least for one conditional case). I didn't try it by myself.
#derik It worked! for me
the second list is populating based on the choice of the first element.
I used Active Choice reactive parameter plugin,
the requirement was the first param will list my servers,
based on the fist selection, the second parm is to connect to selected server and list the backup.
so the list of available backup will the shown here to restore.
enabled parameterized.
Select Choice Parameter
Name: Server
Choices : Choose..
qa
staging
master
Description : Select the server from the list
Add new parameter "Active Choice Reactive Parameter"
Name: Backup
Script: Groovy Script
def getbackupsqa = ("sshpass -f /opt/installer/pass.txt /usr/bin/ssh -p 22 -o StrictHostKeyChecking=no myuser#111.22.33.44 ls /opt/jenkins/backup").execute()
if (Server.equals("Choose..")) {return ['Choose..'] }
else if (Server.equals("qa")) {return getbackupsqa.text.readLines()}
else if (Server.equals("staging")) {return ['Staging server not yet configured']}
else if (Server.equals("master")) {return ['Master server not yet configured']}
Description : Select the backup from the list
Referenced parameters : Server
The result as here
Fellow TFS users and/or junkies,
We are using TFS 2013. When I add required for Description HTML (Microsoft.VSTS.Common.DescriptionHTML), the default value still shows up as "As a I want so that ", THUS it doesn't require the user to fill anything in and it doesn't show up yellow. Sure, I could change the field, but we already have many things linked to Description HTML and can't risk changing the fields (reports and such are already setup). How would I change this so either:
A. It is empty and will show up required OR
B. It requires the user to change the value
Things I tried:
Setting the value to empty. Won't allow me to have both empty AND required.
Setting Default Value to empty. Won't allow me to that either.
Setting Prohibited Values to the default text it has. Not allowed for the field.
Applying a WhenNotChanged rule for the field and setting it to required. It already has a value so it doesn't matter if it's required or not.
I've just looked into a similar tfs machine.
It's just a defined "Default" rule but not in the "Fields" tab but in workflow tab.
In my case, it was in the initial transition rule.
To be specific:
Like you can guess, using Power Tools;
open the work item
go to the "Workflow" tab.
In the designer, double click the (most possibly) first transition element to view its settings
In the window opened, go to the "Fields" tab
If you see "Description" field there, double click it
Remove the "Default" rule
Now, you don't have a default text. You can set it "Required" and it'll be ok.
Close all, go to Fields tab of work item and set a required rule in a way as you expected initially.