Tableau: filter value N/A in the URL not working - tableau-api

One of my filters has value "N/A" and I want to pass it in the URL when a dashboard is opened. We are also using JS API to embed dashboards and our Tableau Server Version is 2019.3.1
I have tried many things but the filter does not load with N/A applied. I have checked the tableau kb article https://kb.tableau.com/articles/issue/special-characters-in-url-parameters and tried but it does not work.
Passing N/A in the url
%26Operator%3DWolverine%26State%3DUtah%26First%5c%20Production%5c%20Year%3DN%5C%2FA
&Operator=Wolverine&State=Utah&First%5c%20Production%5c%20Year=N%5C%2FA
&Operator=Wolverine&State=Utah&First+Production+Year=N%5C%2FA
&Operator=Wolverine&State=Utah&First+Production+Year=N%2FA
I have also tried to pass the value in JS like below
tableauViz = new tableau.Viz(frameDiv[0], url, {
highdpi: true,
hideTabs: true,
hideToolbar: true,
"Operator": "Wolverine",
"First Production Year": "N/A",
});
But none of the above work, has anyone encountered such issue? Any help in this would be greatly appreciated.

I am fairly certain however you attempt to pass N/A, that / is going to be interpreted as a locator. I would suggest you add in some logic in the JS to interpret N-A, or NA, or Z35 as your N/A. Either that or add a calculated field and a case statement to convert your N/A to a number.
An excerpt from the link you included in your question, states / is a reserved character.
Network Working Group: Uniform Resource Identifiers (URI): Generic Syntax - 2.2.
Reserved Characters.
According to the above resource, the following characters are "reserved" (likely to cause errors in URLS unless encoded): ! * ' ( ) ; : # & = + $ , / ? # [ ]

Related

Grafana: Overrriding series with metric named `/var(avail_MB)`: "Panel rendering error '/var(avail_MB)' is not a valid regular expression."

An Icinga2 plugin (written by myself) returns performance data with metrics named /var(avail_MB), /var(total_MB) and similar. Data is forwarded to an InfluxDB with Grafana as Frontend.
I'm using "GROUP BY" "tag(metric)" and "ALIAS BY" "$tag_metric" in a dashboard's panel query.
The metric names are displayed correctly below the graph then.
However when I try to override series by specifying "alias or regex" /var(avail_MB) it does not seem to work, and when going back from panel configuration to dashboard, I get an error message saying "Panel rendering error '/var(avail_MB)' is not a valid regular expression.".
I tried to put a backslash in front of ( and ), but that didn't help.
To make matters worse, the whole graph disappeared, and when trying to open the "Query Inspector", the frontend seems to take forever (Query never appears).
What is the problem, and how could I fix it?
I'm new to Icinga2, Grafana and InfluxDB (I'm just a "user" not administrator of those).
The color change is not applied to the graph.
Here is an example of plugin output:
OK: /var: 3114/5632MB (55.30%), slope is NaN|/var(total_MB)=5631.56MB;;;0 /var(avail_pct)=55.30%;25;5;0;100 /var(avail_MB)=3114.12MB;10;5;0;5632 /var(est_avail_MB)=nanMB;10;5;0;5632
(The "nanMB" was a bug in the plugin that has been fixed already, but that data wasn't from the machine in question.)
The problems seems to be the beginning of the string ("/var").
Grafana seems to treat every string starting with / as regular expression, and it expects any regular expression to start with /, too (it seems).
So the fix was to add a trailing /, and escape the literal / as \/.
Unfortunately this only removes the error message, but doesn't make the override work (match).
It is also required to backslash-escape the parentheses and the slash(es):
Instead of /var(total_MB) you need to write /\/var\(total_MB\).
The original problem has two origins:
The monitoring plugin specification at https://www.monitoring-plugins.org/doc/guidelines.html#AEN201 states: "2. label can contain any characters except the equals sign or single quote (')") states that any character except = and ' is allowed as metric name.
Grafana v6.7.3 proposes the incorrect (i.e.: unescaped) values for "alias or regex".
That is how I had created the problem.

Jira Cloud search via REST API for the issue with multiple special characters

We have a couple of issues in Jira Cloud having names that contain multiple special characters. Examples:
My i$$ue
#nother issue
R&D related issue
s#me issue
s###me issue
$simple issue
Looking for a way of searching issues using REST API.
First I tried simple GET search like this: akceptor.atlassian.net/rest/api/3/issue/picker?query=s#me
It returns issues with 's#me' clause in the name but if you use partial name in search i.e. ?query=s# - the issue with name containing ### won't be found. Also does not work for &, $ and some other characters.
The next thing I tried was POST search using JQL. I.e. hitting akceptor.atlassian.net/rest/api/3/search resource with the following body:
{
"expand": [
"names"
],
"jql": "text ~ \"s#\"",
"maxResults": 15,
"fieldsByKeys": false,
"fields": [
"summary",
"status",
"assignee"
],
"startAt": 0
}
This found 's###me issue' but not 's#me issue'.
Worked better for issue names containing & and $ characters but still requires a full word to be included in the JQL query in some cases.
Documentation available gives a list of unsupported special characters but it looks like there is an issue with words containing chains of supported characters as well.
Any ideas how to properly search for both 's#me' and 's###me'?
Especially in cases when we don't want to specify the beginning of word (i.e. we are interested in something ending with '#me')
Contacted Atlassian supports and they confirmed a bug:
If you perform a search using special character in the quick search, it will return no results.
Affected characters:
/ _ - &
https://jira.atlassian.com/browse/JRACLOUD-71066

Apply Command to String-type custom fields with YouTrack Rest API

and thanks for looking!
I have an instance of YouTrack with several custom fields, some of which are String-type. I'm implementing a module to create a new issue via the YouTrack REST API's PUT request, and then updating its fields with user-submitted values by applying commands. This works great---most of the time.
I know that I can apply multiple commands to an issue at the same time by concatenating them into the query string, like so:
Type Bug Priority Critical add Fix versions 5.1 tag regression
will result in
Type: Bug
Priority: Critical
Fix versions: 5.1
in their respective fields (as well as adding the regression tag). But, if I try to do the same thing with multiple String-type custom fields, then:
Foo something Example Something else Bar P0001
results in
Foo: something Example Something else Bar P0001
Example:
Bar:
The command only applies to the first field, and the rest of the query string is treated like its String value. I can apply the command individually for each field, but is there an easier way to combine these requests?
Thanks again!
This is an expected result because all string after foo is considered a value of this field, and spaces are also valid symbols for string custom fields.
If you try to apply this command via command window in the UI, you will actually see the same result.
Such a good question.
I encountered the same issue and have spent an unhealthy amount of time in frustration.
Using the command window from the YouTrack UI I noticed it leaves trailing quotations and I was unable to find anything in the documentation which discussed finalizing or identifying the end of a string value. I was also unable to find any mention of setting string field values in the command reference, grammer documentation or examples.
For my solution I am using Python with the requests and urllib modules. - Though I expect you could turn the solution to any language.
The rest API will accept explicit strings in the POST
import requests
import urllib
from collections import OrderedDict
URL = 'http://youtrack.your.address:8000/rest/issue/{issue}/execute?'.format(issue='TEST-1234')
params = OrderedDict({
'State': 'New',
'Priority': 'Critical',
'String Field': '"Message to submit"',
'Other Details': '"Fold the toilet paper to a point when you are finished."'
})
str_cmd = ' '.join(' '.join([k, v]) for k, v in params.items())
command_url = URL + urllib.urlencode({'command':str_cmd})
result = requests.post(command_url)
# The command result:
# http://youtrack.your.address:8000/rest/issue/TEST-1234/execute?command=Priority+Critical+State+New+String+Field+%22Message+to+submit%22+Other+Details+%22Fold+the+toilet+paper+to+a+point+when+you+are+finished.%22
I'm sad to see this one go unanswered for so long. - Hope this helps!
edit:
After continuing my work, I have concluded that sending all the field
updates as a single POST is marginally better for the YouTrack
server, but requires more effort than it's worth to:
1) know all fields in the Issues which are string values
2) pre-process all the string values into string literals
3) If you were to send all your field updates as a single request and just one of them was missing, failed to set, or was an unexpected value, then the entire request will fail and you potentially lose all the other information.
I wish the YouTrack documentation had some mention or discussion of
these considerations.

Using Substitution on Text Field - Appian Expression Editor

I am currently trying to figure out how to use the Substitute() function provided by Appian on a text field. Specifically, I am trying to substitute the "&" with & amp; because the ampersand is causing me issues when I try to save the form with a certain value.
Every combination that I've tried has given me an error that will either prevent me from saving my changes, or causes an error when I try to use the form it's related to. Has anyone used the Expression Editor in Appian before and knows how to use the substitution function with the code below?
We are currently using an older version of Appian (version 7.10).
Also - there is currently no tag available for Appian so I am unable to tag it properly :(
If there is any additional information I can provide to get this solved, please let me know.
a!textField(
label: "Line Item Text " & ri!index,
value: ri!items[ri!index].itemText,
saveInto:
{
ri!items[ri!index].itemText,
if(rule!APN_isBlank(ri!write), {}, a!save(ri!write, false))
},
align: "RIGHT",
required: true,
validationGroup: ri!validationGroup
)
Here is a snippet:
load(
local!sample: "123&gas",
substitute(local!sample, "&", "& amp")
)

Grails searchable plugin: limitless results

The searchable plugin seems to default to only 10 results. How do I change this to return all results?
# Bill
I'm looking for something like this:
DomainClass.search("This is the query", [max:every_last_one_of_em])
I could put a limit of like 40 and probably be fine, but the purpose of this search is to give a human a list of similar things to disambiguate, so if some of the things are missing the stupid humans will likely use "assumption" to get the wrong answers.
From the documentation at: http://grails.org/Searchable+Plugin+-+Methods+-+search
Options affecting the return value
max - The maximum number of results to return (default 10). Only used with result: "searchResult"
So it seems you'll need to pass in a Map of options to your search call, like:
DomainClass.search( "This is the query", [max:1000] )
Note, having an "unlimited" search result is a Bad Idea(TM). Figure out the max you want to handle and use that as your limit.
I would suggest having a "large" limit, if you must. If you get back that many, then do a further query to find out how many there are (there is an option for that too), and display a message to the user that "This is an incomplete set, please further restrict your view" or some such.
If you absolutely MUST show them all. Then use that count query (it's an option in the page I listed above), then resend the search using that count as the max.
Mikey to make the search return all results just remove the max field from the defaultMethodOptions.
You can find this declaration in Configuration -> Searchable.groovy
defaultMethodOptions = [
search: [reload: false, escape: true, offset: 0, max: 10, defaultOperator: "and"],
suggestQuery: [userFriendly: true]
]