Redmine Add multiple watchers through rest api - redmine

I need to create Redmine issues through api. I have an xml draft, that is posted to the redmine by wget.exe. The xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<issue>
<project_id>145</project_id>
<tracker_id>10</tracker_id>
<category_id>885</category_id>
<subject>subj</subject>
<description>descript</description>
<watcher_user_ids>1333,1614</watcher_user_ids>
</issue>
It works almost fine except adding watchers to the issue. According to documentation parameter <watcher_user_ids> contains array of watchers. But I can't make it work for multiple watchers. Somehow it adds only the first one and others are ignored. I've tried to use ";", "," separators, different brackets, but it doesn't help. I guess I'm doing something wrong. Can please anybody help me and show me the right way.

I could not make this work at all with Redmine version 2.5.2.stable. The only thing that worked for me is:
POST /issues/[id]/watchers.[format]
where watchers.json is:
{"user_id": "11"}
It makes sense since the watchers table references the issue and the issue contains no reference to watchers.

<watcher_user_ids>1333</watcher_user_ids>
<watcher_user_ids>1614</watcher_user_ids>

I had the same problem. To solve I changed XML to JSON format and everything worked perfectly:
{
"issue": {
"project_id": 145,
"category_id": 885
"subject": "subj",
"description": "descript",
"watcher_user_ids": ["133","1614"]
}
}

You have to add a line for each watcher you want to add.
<watcher_user_ids>1333</watcher_user_ids>
<watcher_user_ids>1614</watcher_user_ids>
In this example 2 watchers will be added.

Related

How to link bigcartel subdomain to dugway barebones site

Hello I am trying to learn how to develop big cartel themes with the dugway api and I am having trouble linking to the subdomain of a companies current products. Per the documentation it says I need to put in the subdomain in the config file.
This is what I have tried so far, in the dugway.json file I have this "store": {
"subdomain": "kounterfitklothing"
},
and then restarting the dugway server. Once I do that and refresh the page I still see the dugway barebones page.
I also tried adding options[:store] = 'kounterfitklothing' to the config.ru file and nothing happens. Any help would be greatly appreciated.
I can confirm that with the latest version, inserting this into the dugway.json file will load the store properly (config.ru is no longer used for loading the store):
{
"store": {
"subdomain": "kounterfitklothing"
}
}
It could be ignoring the setting if you're missing the first set of open/close braces as well, so double check that - and make sure you're using the latest version of Dugway as well.
I figured it out, I didn't remove the comma after the curly brace.

AWS Cloudsearch strange issue

I uplaoded a JSON to cloudsearch with 1 field is 'text' type and searchable. It contains a word 'Residential'.
However if I use 'Residentia*', it shows me no search result. But using 'Residenti*' or 'Residential' is fine.
Who know about that? Thanks heaps!
I ran into similar issues with Cloudsearch and I searched everywhere for the answer. I eventually came across a piece about "Algorithmic Stemming": https://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-analysis-schemes.html.
The default stemming level for English text is "full". I created a custom analysis scheme with stemming set to "None" and applied that to most fields in document and it solved my problems.

TrimDuplicates element of Microsoft.Search.Query Webservice causes a FormatException

I'm trying to search through a site collection and find all sites that contain a particular file. TrimDuplicates is supposed to be the right way to do that. I'm calling QueryEx of the WebService object with the following XML as the string argument.
<QueryPacket xmlns='urn:Microsoft.Search.Query'>
<Query>
<TrimDuplicates includeid="false">False</TrimDuplicates>
<SupportedFormats>
<Format revision='1'>urn:Microsoft.Search.Response.Document:Document</Format>
</SupportedFormats>
<Context>
<QueryText language='en-us' type='STRING'>
"filenameForQuery"
</QueryText>
</Context>
</Query>
</QueryPacket>
The response from search.asmx is a 500 error with System.FormatException as the only piece of useful information.
It's only the TrimDuplicates element that is triggering the formatexception. Fiddling the case of the two Falses hasn't had any effect so far.
The answer is actually blindingly obvious - remove the includeid attribute and make the content of TrimDuplicates lower case.
Just wanted to point out that includeid should actually be an integer value.
More here
But as you said, it's not necessary.

how to use wicket XsltTransformerBehavior when I have multiple .xsl files

I'm working part of a project that needs to display a .xml file with .xsl files.
Here's part of the code:
FILE_PATH = "myxsl.xsl"
...
Label content = new Label("content",xmlContent);
content.setEscapeModelStrings(false);
content.add(new XsltTransformerBehavior(FILE_PATH));
add(content);
...
Currently the page works if I use only one .xsl file. However, because the .xsl files I need to deal with can be really long, they are separated into several components.
for example, I will have
mymain.xsl, head.xsl, tables.xsl
the mymain.xsl has inclusion of the other like this
<xsl:include href="head.xsl"/>
<xsl:include href="tables.xsl"/>
I tried to set FILE_PATH to mymain.xsl, but it didn't work. The program can find mymain.xsl but cannot compile the stylesheet because it cannot find head.xsl and tables.xsl
I've been searching for a long time but still have no clue how to do this. Really appreciate any help. Thanks in advance.
I looked at the documentation of XsltTransformerBehavior, and it looks like it doesn't expose the functionality to set a custom URI resolver (which is basically what you want to do).
However, in the case that no-one else has a better solution, I can propose a workaround: Write an XSLT that merges your XSLT files into one file. See here for an XSLT that does this. If you're using Maven as build system, you can do this automatically in the generate-resources phase using the transform goal of the Maven XML Plugin. You can then associate the XsltTransformerBehavior with the single-file XSLT which will be available at run-time.

What is wrong with this regex for content_scripts?

I dont want it to run on tv.sme.sk. Why it still keeps coming up there
"content_scripts": [
{
"matches": ["http://*.sme.sk/*"],
"exclude_matches": ["http://tv.sme.sk/*"],
"js": ["script.js"],
"css": ["style.css"]
}]
I've checked it on a minimal example and it looks like you found a bug in Chrome. Funny part is that only CSS is injected to tv.sme.sk, javascript injection works as expected and follows the exclude_matches setting. I've played with include_globs and exclude_globs options but no luck.
Your best option is to inject CSS using insertCSS method.
EDIT
Yepp, this is a known bug.