I would like to create an issue by jira4r gem and attach it to special components. I use code as you see below.
jira = Jira4R::JiraTool.new(2, "http://example.com/jira/")
jira.login("robot", "robot")
issue = Jira4R::V2::RemoteIssue.new
issue.project = "ABC"
issue.type = "1"
issue.components = ['10000']
issue.summary = "Do somethigs"
issue.assignee = -1
jira.createIssue(issue)
but there is a problem that it return an error
SOAP::FaultError java.lang.IllegalArgumentException: array element type mismatch
and it is caused by setting "components"
Do you have some ideas how to fix it?
yay! I found the solution, mb it helps someone
component = Jira4R::V2::RemoteComponent.new(10010)
componentlist = Jira4R::V2::ArrayOf_tns1_RemoteComponent.new.push(component)
issue.components = componentlist
According to http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client you need remote component instead of component id.
Smth like
issue.components = [Jira4R::V2::RemoteComponent.new('10000')]
Related
I have a selection field and this function for list items in field by dynamically.
def get_years(self):
year_list = []
year = date.today().year+1
lastyear = date.today().year - 20
for i in range(int(lastyear),int(year)):
year_list.append((i, str(i)))
return year_list
this is the field,
year = fields.Selection(get_years, string='Yıl', default=get_current_year, restore="True")
and when I save the form, this field becomes unknown. I found what is the problem but I don't know the solution. Problem is compute function, when i write items like [(1997,1997),(2016,2016),(2017,2017)] it is working but i don't want to write hard code. How can i solve this problem? Thank you.
I found the solution, i don't need to create a new method and can use like;
year = fields.Selection([(num, str(num)) for num in range(1900, (datetime.now().year)+1 )],string='Year', default=datetime.now().year)
Thanks.
I'm trying to write a script for DC++ hub based on Ptokax running on lua
i'm trying to assign the nick(a variable) which has punctuation in between but it gives nil values
(sPattern is ! already assigned in script)
sData = "[11:03:30] !spm sTo_Nick sFromNick message to be sent"
cmd,sToNick1,sToNick2,sFromNick ,sMessage = string.match(sData, "%b<>%s["..sPattern.."](%a*)(%s+)(%w*)(%s+)(%w*)(%s+)(%.*)")
what i want to be assigned is
cmd = spm
sToNick1 = sTo ,
sToNick2 = Nick ,
sFromNick = sFromNick ,
sMessage = message to be sent
what i'm getting is
spm sTo _ Nick
as can be seen here https://repl.it/BrAg/3
can anyone please suggest the edit or help.
You need to rearrange the capture groups:
cmd,sToNick1,sToNick2,sFromNick,sMessage =
string.match(sData, "%b<>%s["..sPattern.."](%a*)%s+(%w*)"..pattern.."(%w*)%s+(%w*)%s+(.*)")
See the updated demo
I created a custom extension for TYPO3 CMS.
It basically does some database queries to get text from database.
As I have seen, TYPO3 editor, transforms data before storing it in database so for example a link <a href="....." >Link</a> is stored as <link href>My Link Text</link> and so on for many tags like this.
when I query data from DB, I get it as it is stored in DB (<link href>My Link Text</link>)
so links are not displayed as they shoud. They display as normal text..
As far as I know there are two ways to go:
disable RTE transformations (how to do that?)
use lib.parseFunc_RTE (which i have no Idea how to configure it properly)
any idea?
thanks.
I guess you're not using Extbase and Fluid? Just as a reference, if you are using Extbase and Fluid for your extension you can render text from the RTE using Fluid:
<f:format.html>{bodytext}</f:format.html>
This uses lib.parseFunc_RTE to render the RTE text as HTML. You can also tell it to use a different TypoScript object for the rendering:
<f:format.html parseFuncTSPath="lib.my_parseFunc">{bodytext}</f:format.html>
Useful documentation:
parseFunc
Fluid format.html
I came across the same problem, but using EXTBASE the function "pi_RTEcssText" ist not available anymore. Well maybe it is, but I didn't know how to include it.
Anyway, here's my solution using EXTBASE:
$this->cObj = $this->configurationManager->getContentObject();
$bodytext = $this->cObj->parseFunc($bodyTextFromDb, $GLOBALS['TSFE']->tmpl->setup['lib.']['parseFunc_RTE.']);
This way I get the RTE formatted text.
I have managed to do it by configuring the included typoscript:
# Creates persistent ParseFunc setup for non-HTML content. This is recommended to use (as a reference!)
lib.parseFunc {
makelinks = 1
makelinks.http.keep = {$styles.content.links.keep}
makelinks.http.extTarget < lib.parseTarget
makelinks.http.extTarget =
makelinks.http.extTarget.override = {$styles.content.links.extTarget}
makelinks.mailto.keep = path
tags {
link = TEXT
link {
current = 1
typolink.parameter.data = parameters : allParams
typolink.extTarget < lib.parseTarget
typolink.extTarget =
typolink.extTarget.override = {$styles.content.links.extTarget}
typolink.target < lib.parseTarget
typolink.target =
typolink.target.override = {$styles.content.links.target}
parseFunc.constants =1
}
}
allowTags = {$styles.content.links.allowTags}
And denied tag link:
denyTags = link
sword = <span class="csc-sword">|</span>
constants = 1
nonTypoTagStdWrap.HTMLparser = 1
nonTypoTagStdWrap.HTMLparser {
keepNonMatchedTags = 1
htmlSpecialChars = 2
}
}
Well, just so if anyone else runs into this problem,
I found one way to resolve it by using pi_RTEcssText() function inside my extension file:
$outputText=$this->pi_RTEcssText( $value['bodytext'] );
where $value['bodytext'] is the string I get from the database-query in my extension.
This function seems to process data and return the full HTML (links, paragraphs and other tags inculded).
Note:
If you haven't already, it requires to include this file:
require_once(PATH_tslib.'class.tslib_pibase.php');
on the top of your extension file.
That's it basically.
I wanted to get an object on production and do an exact replica( copy over its contents) to another object of same type. I tried doing this in 3 ways from ruby console which none of them worked:
Let's say you have the tt as the first object you want to copy over and tt2 as the replica object. The first approach I tried is cloning the array
tt2.patients = tt.urls.patients
tt2.doctors = tt.segments.doctors
tt2.hospitals = tt.pixels.hospitals
Second approach I tried is duplicating the array which is actually the same as cloning the array:
tt2.patients = tt.patients.dup
tt2.doctors = tt.doctors.dup
tt2.hospitals = tt.hospitals.dup
Third approach I tried is marhsalling.
tt2.patients = Marshal.load(Marshal.dump(tt.patients))
tt2.doctors = Marshal.load(Marshal.dump(tt.doctors))
tt2.hospitals = Marshal.load(Marshal.dump(tt.hospitals))
None of the above works for deep copying from one array to another. After trying out each approach individually above, all the contents of the first object (tt) are nullified (patients, doctors and hospitals are gone). Do you have any other ideas on copying the contents of one object to another? Thanks.
Easy!
#new_tt = tt2.clone
#new_tt.patients = tt2.patients.dup
#new_tt.doctors = tt2.doctors.dup
#new_tt.hospitals = tt2.hospitals.dup
#new_tt.save
This is what ActiveRecord::Base#clone method is for:
#bar = #foo.clone
#bar.save
Ruby Facets is a set of useful extensions to Ruby and has a deep_clone method that might work for you.
We are trying to upgrade from an older version of Zend Framework to the most recent one (1.11).
We have to send some ArrayCollections to a Flex-app that I can not access. Previous versions of ZF's Zend_Amf_Value_Messaging_ArrayCollection have a source attribute which the newer versions don't have.
I have tried editing the Zend_Amf_Value_Messaging_ArrayCollection class to have that source property, but it seems like ZF doesn't send objects to the Flex-app (I've noticed that via a debugging proxy). The ArrayCollection still has the correct keys (AFAIK, going from 0 -> 3), but the values are NULL.
This is from a small test-file:
$c = new RoomCategoryVO();
$c->name = 'root';
$c->childCategories = new Zend_Amf_Value_Messaging_ArrayCollection();
$cc1 = new RoomCategoryVO();
$cc1->sortPriority = 2;
$cc1->name = $this->xml->roomService->windows;
$cc1->parentCategory = $c;
$cc1->childItems = new Zend_Amf_Value_Messaging_ArrayCollection();
$re11 = new ElementVO();
$re11->id = "simpleWindow";
$re11->name = $this->xml->roomService->window;
$re11->type = 'SIMPLE_WINDOW';
$re11->icon = 'assets/runtime/images/schemeIcons/simpleWindow.png';
//$cc1->childItems->source[] = $re11;
$cc1->childItems[] = $re11;
//$c->childCategories->source[] = $cc1;
$c->childCategories->append($cc1);
In comments you see the 'old' way of ZendAMF, below them the new way.
Is there any way to get ZendAMF use the source property again without going back to an older version of ZF?
We finally settled on using ZendAMF, with only the Zend_Amf_Value_Messaging_ArrayCollection from the previous version being:
class Zend_Amf_Value_Messaging_ArrayCollection
{
public $source;
}
This allows us still using the source property.