Log work for a given issue using JIRA SDK - ruby

I am using JIRA Ruby SDK for JIRA REST API. I am trying to create to log work for a specific issue with this code:
projects = client.Project.all
issue = client.Issue.find("13921")
w = issue.worklogs.build
w.timeSpentSeconds = "12000"
However i have got this error:
method_missing': undefined methodtimeSpentSeconds=' for
#JIRA::Resource::Worklog:0x007f831db3f360 (NoMethodError) from jira.rb:33:in
Thanks!

Related

Symfony 4.4 getRepository No Longer Working

I recently updated a Symfony app to 4.4 from 4.2 and now my getRepository calls no longer work.
I was calling getting my repos like this:
$oems = $em->getRepository('App:OEM')->findAll();
After reading about the issue I changed to this:
$oems = $this->getDoctrine()->getRepository(OEM::class)->findAll();
But now I get this error:
Class "App\Controller\OEM" does not exist
Fixed it. I wasn't including the class. Added this and it worked:
use App\Entity\OEM;

Getting undefined method when trying to use a ruby wrapper for the Spotify Web API

I was messing around with RSpotify which is a ruby wrapper for the Spotify API.
I added a form and sent the search result param to be looked up in the API but i'm getting the following error:
NoMethodError: undefined method `empty?' for nil:NilClass
from /Users/user/.rvm/gems/ruby-2.3.1/gems/rspotify-1.21.0/lib/rspotify/connection.rb:71:in `send_request'
I double checked and reinstalled the gem, added it to the gemfile and everything. I can't seem to figure out why it's not working.
Here's the code (It was working a few weeks ago when I wrote it):
post '/music' do
search = RSpotify::Artist.search(params[:search])
#artist = search.first
#image = #artist.images.first["url"]
#top_tracks = #artist.top_tracks(:US)
albums = #artist.albums
#titles = []
albums.each { |album| #titles << album.name }
#titles.uniq!
#related_artists = #artist.related_artists
erb :'/music/show'
end
You seem to be using an outdated version (1.21.0, judging by your output). The current version is 1.22.1 (see https://rubygems.org/gems/rspotify) => maybe try updating.
Also, like Jeff said: Apparently there's an open GitHub issue that says that this issue occurs when you're not properly authenticated. So maybe check that your credentials are 1) set and 2) still valid. A simple way to check your credentials is to simply use them with the API directly (see http://www.compciv.org/recipes/data/touring-the-spotify-api/) => if they don't work there, it's probably not the code but your credentials that aren't working properly.

Parse.com and Chrome Packaged Apps

This question was already asked in the old Parse.com help forums :
https://www.parse.com/questions/parsecom-javascript-api-and-chrome-packaged-apps
Has there been any progress on adapting the parse js.sdk to be compatible with Chrome Packaged Apps ???
In particular it seems to fail on this line :
var userData = Parse.localStorage.getItem(Parse._getParsePath(
Parse.User._CURRENT_USER_KEY));
with the following error message :
Uncaught TypeError: Cannot read property 'getItem' of undefined

Troubles setting up Rally to Jira Connector

I am working with Jira/Rally and the the Ruby connector. I was tapped to test out the connector and make sure it will do everything we need. I have to confess that this isn't my area of expertise, I am unable to find relevant help on the Rally site and the previous topics here were tied to different issues.
The error I am running into is:
[2013-01-18 15:21:38 Z] DEBUG : Finding method getIssuesFromJqlSearch
[2013-01-18 15:21:39 Z] ERROR : ConnectorRunner.rescue in run_services - Unexpected exception occurred
[2013-01-18 15:21:39 Z] ERROR : ConnectorRunner.exception - Message undefined method `key' for nil:NilClass
[2013-01-18 15:21:39 Z] ERROR : ConnectorRunner.exception - Stack Trace
I am connecting to both services just fine (after having worked through some fun proxy issues), and am working off the base jira_config.xml that comes with the connector. I have changed only the required fields, ie UN/PW/URL/Project/Workspace
Relevant xml code:
<RallyConnection>
<Url>rally1.rallydev.com</Url>
<WorkspaceName>CMSJiraIntegrationTestWorkspace</WorkspaceName>
<Projects>
<Project>Sample Project</Project>
</Projects>
<User>***************</User>
<Password>encoded-T-i-F-j-b-2-x-l-M-j-A-=-</Password>
<ArtifactType>Defect</ArtifactType>
<ExternalIDField>JiraDefectKey</ExternalIDField>
<CrosslinkUrlField>JiraLink</CrosslinkUrlField>
</RallyConnection>
<JiraConnection>
<Url>http://10.34.10.175:8080</Url>
<User>***************</User>
<Password>encoded-a-m-F-t-Z-X-M-u-Y-m-V-p-b-n-M-=-</Password>
<ArtifactType>Bug</ArtifactType>
<Project>SP</Project>
<ExternalIDField>RallyID</ExternalIDField>
<CrosslinkUrlField>RallyURL</CrosslinkUrlField>
<CopySelectors>
<CopySelector>Status != Closed</CopySelector>
</CopySelectors>
</JiraConnection>
Does anyone have insight as to why this would fail?
The help is much appreciated
Are you sure you've got JIRA remote API enabled? It seems to crash just after looking for SOAP method "getIssuesFromJqlSearch".
Could you please post the full log file generated from starting the connector to when it crashed?

Not Able to Take Screenshot on Safari using Grid and RemoteWebDriver

I am trying to get a screenshot from Safari using Grid and RemoteWebDriver. I have tried the following approaches:
Using the code below. It works on all browsers except Safari. I also tried returning a BASE64 string but didn't work.
WebDriver augmentedDriver = new Augmenter().augment(driver);
File source = ((TakesScreenshot)augmentedDriver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(source, new File("screenshot.png"));
Exception: org.openqa.selenium.WebDriverException
Using WebDriverBackedSelenium. This throws exception.
a.
Selenium sel = new WebDriverBackedSelenium(driver, driver.getCurrentUrl());
sel.captureScreenshot(filename);
Exception: java.lang.UnsupportedOperationException: captureScreenshot
b.
Selenium sel = new WebDriverBackedSelenium(driver, driver.getCurrentUrl());
sel.captureScreenshotToString();
Exception: java.lang.UnsupportedOperationException: WebDriver does not implement TakeScreenshot
I tried sending the key sequence that takes screen shots in MAC (command+shift+3) using sendKeys(Keys.chord(Keys.COMMAND, Keys.SHIFT, "3")) but Keys.COMMAND is not considered as modifier key so this also didn't work.
After some research I came across the issue below:
http://code.google.com/p/selenium/issues/detail?id=4203
I also saw this revision which is suppose to fix the issue but I am not able to figure out how to implement this
http://code.google.com/p/selenium/source/detail?r=17731
I would really appreciate if I could get some help on this. I am using MAC, Safari 5.1.7 and selenium 2.25.
For future reference: this seems to have been fixed in Selenium 2.26

Resources