I am looking for a way to search issue based on summary in Jira.
There are couple of functions to search issue, the one i need is "getIssuesFromTextSearchWithProject" but when i use it, it does not return issues just from that project but returns related issues from all projects.
Any ideas? I am doing this in PHP.
$result = $soap->getIssuesFromTextSearchWithProject($authtoken,"PROJECT_NAME", "Search String",10);
My Fault :
Project name needs to be array of projects :(
So this worked :
$projects = array("PROJECT_NAME");
$result = $soap->getIssuesFromTextSearchWithProject($authtoken,$projects, "Search String",10);
Related
SilverStripe: v4
Module used: https://github.com/unclecheese/silverstripe-display-logic
Hello and good day!
I'm in the Security page (Lists of Members) and was trying to display a ListboxField upon a certain string or value is found on another ListboxField.
.
With The image above, I wanted to select or input in the Groups field the Sales Representative role, and once the Sales Representative is present in the Groups, that's the moment I shall display another field
Here's my code snippet
$codesList = Member::get()->column('Code');
$codes = ListboxField::create(
'AccountPurchases',
'Account Purchases',
$codesList);
$fields->insertAfter('DirectGroups', $codes);
$codes->displayIf("DirectGroups")->contains("Sales Representative");
But the problem is, no matter what I did (1: dev/build?flush=1, 2: refresh the page, 3: restart the app) the desired field named $codes still won't appear.
But if I'm applying it to a normal field like the FirstName (which is a simple TextField), it's working perfectly fine...
$codesList = Member::get()->column('Code');
$codes = ListboxField::create(
'AccountPurchases',
'Account Purchases',
$codesList);
$fields->insertAfter('DirectGroups', $codes);
$codes->displayIf("FirstName")->contains("Sales Representative");
Any ideas how to perform my desired output?
For non-standard form fields, you'll need to use the display-logic wrapper. https://github.com/unclecheese/silverstripe-display-logic#dealing-with-non-standard-form-fields
The definition of "non-standard" is a bit hard to find, but in my experience it's anything non-plain-html-input. Listbox is a fancy front-end thing, so it qualifies. The examples in the docs can be confusing, but if you are using SS4 and the latest display-logic, then use Wrapper::create instead of DisplayLogicWrapper::create. If you wrap it, it should work.
$codesList = Member::get()->column('Code');
$codes = Wrapper::create(
ListboxField::create('AccountPurchases','Account Purchases',$codesList);
)->displayIf("DirectGroups")->contains("Sales Representative")->end();
$fields->insertAfter('DirectGroups', $codes);
I am having a small problem adding multiple dimensions to the API request for Search Console.
If I add the following to group by country it works fine.
$filters->setDimension("country");
$filters->setOperator("equals");
$filters->setExpression($country);
$filter->setFilters($filters);
$filter->setFilters(array($filters));
$request->setDimensionFilterGroups(array($filter));
But if I add another dimension below for device, it skips the country dimension and only runs the query with the device dimension. It's perfectly possible to run both according to this on the search console API site:
'filters': [{
'dimension': 'country',
'expression': 'ind'
}, {
'dimension': 'device',
'expression': 'MOBILE'
}]
So, any idea how I can use them both on a query?
It's probably simply some PHP code, but I can't find any documentation on multiple dimensions or any examples anywhere with PHP in mind.
It was simple.
$filters->setDimension("country");
$filters->setOperator("equals");
$filters->setExpression($country);
$filters2->setDimension("device");
$filters2->setOperator("equals");
$filters2->setExpression($device);
$filter->setFilters($filters);
$filter->setFilters(array($filters,$filters2));
$request->setDimensionFilterGroups(array($filter));
Works like a charm.
Many thanks for sharing this, Nick - it really helped!
One tiny thing: you won't need the following:
$filter->setFilters($filters);
as you're setting filters the right way with the next line of code.
Also, I was stuck on the following line:
$request->setDimensionFilterGroups(array($filter));
as I was passing the $filter object as it is instead of using an array.
I really found this counter-intuitive: this is the only object setDimensionFilterGroups method needs; I'm still wondering why it needs an array instead.
Cheers,
Sal
Nick's answer did helped me start but currently it isn't complete. To help other devs looking for an answer, hope this would help you:
$filter_group = new Google_Service_Webmasters_ApiDimensionFilterGroup;
$groups = array(['device', 'mobile', 'equals'], ['country', 'GBR', 'equals']);
$filters = array();
if($groups) {
foreach ($groups as $key => $group) {
$filters[$key] = new Google_Service_Webmasters_ApiDimensionFilter;
$filters[$key]->setDimension($group[0]);
$filters[$key]->setExpression($group[1]);
$filters[$key]->setOperator($group[2]);
}
$filter_group->setFilters($filters);
}
$request->setDimensionFilterGroups(array($filter_group));
Also take note, currently it won't work if in your filter group you have two or more same dimension but different value for filter or expression.
e.g.
$groups = array(['device', 'mobile', 'equals'], ['device', 'tablet', 'equals']);
It is because OR operation is currently not supported for filters.
Check here and this answer here.
i'm currently working on a little extension to make it possible to adopt related products of a group product on its associated products.
It work really fine, with the exception, that only the last of the 19 related product is saves and written to the database.
I've checked my source code over and over, even with my team collegue - the code seems to be correct.
In the following i've posted the snippet with the essential parts and i hope that anyone can give me a hint or an advice to solve this problem.
Best regards
Markus
$supplyList =$product->getRelatedProductIds();
$associatedProducts = $product->getTypeInstance(true)->getAssociatedProducts($product);
$params = array();
$_associatedProduct = Mage::getModel('catalog/product');
$prodCount=0;
foreach($supplyList as $sup)
{
$params[$sup] = array('position'=>$prodCount);
$prodCount++;
}
foreach($associatedProducts as $prod)
{
$_associatedProduct
->load($prod->getId())
->setRelatedLinkData($params)
->save();
}
following an update for the problem mentioned in the first post.
Today it worked as it should, without changes made by myself or my collegue.
I'm not sure what the cause of the problem was (caches are disabled since last Monday) and the source was already correct implemented.
It works now and this post is solved, sadly without a solution.
best regards
I'm using the SalesForce PHP Toolkit and getting a connection just fine. But when I use any of the example code - see here
INVALID_FIELD: No such column '' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
I might just be struggling to find the answer because Google won't let me search for ''
The environment is CentOS 6 with PHP 5.3.
I just created an account here to answer this question. It took me all day long to find out this bug in PHP Toolkit. The problem is caused by the "fieldsToNull" property. I read an approx. solution here that gave me an idea where to look for the solution.
So a correct example would be:
$fields = array('LastName' => 'Doe');
$sObject = new SObject();
$sObject->fields = $fields;
$sObject->fieldsToNull = NULL;//this is the solution! :)
$sObject->type = 'Contact';
Then, proceed as usual with the remaining part of the examples of the PHP Toolkit. It worked fine with my Partner WSDL+Developer SF Account.
Hope it helps!
and thanks for reading.
My problem is that I'm trying to get a list of contacts belonging to a group in GData using Zend_Gdata_Query.
Using
$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full/?group=http://www.google.com/m8/feeds/groups/xxx...xxx/base/XXX');
$feed = $gdata->getFeed($query);
give me an "Unknown authorization header".
$query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full/');
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/XXX...XXX/base/XXX');
$feed = $gdata->getFeed($query);
is the same.
Obviously without that parameter I get all the contacts.
I already tried the first method with the parameter in the URL with a modified Extension to CakePHP core HttpSocket and it was working. So I suppose the problem is with Zend stripping out parameters from the url but I had no luck looking at the libraries.
Thanks for any help.
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/myemail%40gmail.com/base/xxxxxxxxxxxxxx');
xxxxxxxxxxxxxx = group ID
As above the max-results also works if you add it to the query string like so:
http://www.google.com/m8/feeds/contacts/default/full?max-results=1000
Note that even in the google documentation the only way of getting ALL results is by 'setting a high number' for the number of results returned. So you can never explicitly specify 'ALL'
I guess you are using 3-legged OAuth. Then you need to add next line before getFeed() called:
$gdata->getHttpClient()->setRequestScheme(Zend_Oauth::REQUEST_SCHEME_QUERYSTRING);
It will solve "Unknown authorization header" error.
For me using
$query->setParam('group', 'http://www.google.com/m8/feeds/groups/XXX...XXX/base/XXX');
returns another error: "Invalid value for group parameter: XXXXXXXXXX" and I still dunno how to fix it :(