{"action":"created","issue":{"url":"https://api.github.com/repos/biouno/uno-choice-plugin/issues/60","labels_url":"https://api.github.com/repos/biouno/uno-choice-plugin/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/biouno/uno-choice-plugin/issues/60/comments","events_url":"https://api.github.com/repos/biouno/uno-choice-plugin/issues/60/events","html_url":"https://github.com/biouno/uno-choice-plugin/issues/60","id":50298054,"number":60,"title":"Supporting Jobs triggered by plug-ins, API and scripts","user":{"login":"bes3","id":9929049,"avatar_url":"https://avatars.githubusercontent.com/u/9929049?v=3","gravatar_id":"","url":"https://api.github.com/users/bes3","html_url":"https://github.com/bes3","followers_url":"https://api.github.com/users/bes3/followers","following_url":"https://api.github.com/users/bes3/following{/other_user}","gists_url":"https://api.github.com/users/bes3/gists{/gist_id}","starred_url":"https://api.github.com/users/bes3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bes3/subscriptions","organizations_url":"https://api.github.com/users/bes3/orgs","repos_url":"https://api.github.com/users/bes3/repos","events_url":"https://api.github.com/users/bes3/events{/privacy}","received_events_url":"https://api.github.com/users/bes3/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/biouno/uno-choice-plugin/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"kinow","id":304786,"avatar_url":"https://avatars.githubusercontent.com/u/304786?v=3","gravatar_id":"","url":"https://api.github.com/users/kinow","html_url":"https://github.com/kinow","followers_url":"https://api.github.com/users/kinow/followers","following_url":"https://api.github.com/users/kinow/following{/other_user}","gists_url":"https://api.github.com/users/kinow/gists{/gist_id}","starred_url":"https://api.github.com/users/kinow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinow/subscriptions","organizations_url":"https://api.github.com/users/kinow/orgs","repos_url":"https://api.github.com/users/kinow/repos","events_url":"https://api.github.com/users/kinow/events{/privacy}","received_events_url":"https://api.github.com/users/kinow/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/biouno/uno-choice-plugin/milestones/2","labels_url":"https://api.github.com/repos/biouno/uno-choice-plugin/milestones/2/labels","id":893501,"number":2,"title":"1.0","description":"","creator":{"login":"kinow","id":304786,"avatar_url":"https://avatars.githubusercontent.com/u/304786?v=3","gravatar_id":"","url":"https://api.github.com/users/kinow","html_url":"https://github.com/kinow","followers_url":"https://api.github.com/users/kinow/followers","following_url":"https://api.github.com/users/kinow/following{/other_user}","gists_url":"https://api.github.com/users/kinow/gists{/gist_id}","starred_url":"https://api.github.com/users/kinow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinow/subscriptions","organizations_url":"https://api.github.com/users/kinow/orgs","repos_url":"https://api.github.com/users/kinow/repos","events_url":"https://api.github.com/users/kinow/events{/privacy}","received_events_url":"https://api.github.com/users/kinow/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":3,"state":"open","created_at":"2014-12-05T22:17:27Z","updated_at":"2015-01-11T03:20:39Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2014-11-27T14:42:14Z","updated_at":"2015-01-11T20:58:21Z","closed_at":null,"body":"In Uno-choice widgets seems that the Value Scripts is not evaluated when the Job is launched from events or automatically (without user interaction) and the parameter is null.\r\n\r\nHere an example of this beahviour comparing Uno-choice widgets (version 0.21) against others common input control widget such as Dynamic Parameter and Dynamic Choice Parameter.\r\n\r\n'''JOB CONFIGURATION AND BUILD VIEW'''\r\nI removed some job and plugin configuration that I left empty.\r\n![img1](https://cloud.githubusercontent.com/assets/9929049/5218317/a80fd82c-764b-11e4-9c84-1ab2c66cbfeb.jpg)\r\n\r\n'''BUILD RESULT'''\r\nI executed two kind of build:\r\n- Build15 has been launched manually by me and as you can see all the parameters are corretly populated\r\n- Build 16 has been launched automatically and Dynamic Parameter and Dynamic Choice Parameter have value but Dynamic Choice Parameter hasn't (it seems that Value Script is not evaluated)\r\n\r\n![ticket2](https://cloud.githubusercontent.com/assets/9929049/5218320/b0dc7d84-764b-11e4-8a5d-0822551b82ed.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/biouno/uno-choice-plugin/issues/comments/69511107","html_url":"https://github.com/biouno/uno-choice-plugin/issues/60#issuecomment-69511107","issue_url":"https://api.github.com/repos/biouno/uno-choice-plugin/issues/60","id":69511107,"user":{"login":"kinow","id":304786,"avatar_url":"https://avatars.githubusercontent.com/u/304786?v=3","gravatar_id":"","url":"https://api.github.com/users/kinow","html_url":"https://github.com/kinow","followers_url":"https://api.github.com/users/kinow/followers","following_url":"https://api.github.com/users/kinow/following{/other_user}","gists_url":"https://api.github.com/users/kinow/gists{/gist_id}","starred_url":"https://api.github.com/users/kinow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinow/subscriptions","organizations_url":"https://api.github.com/users/kinow/orgs","repos_url":"https://api.github.com/users/kinow/repos","events_url":"https://api.github.com/users/kinow/events{/privacy}","received_events_url":"https://api.github.com/users/kinow/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T20:58:21Z","updated_at":"2015-01-11T20:58:21Z","body":"Bit of background to explain what went wrong, and why the dynamic-parameter-plugin worked...\r\n\r\nIn the past we worked only with lists, as the dynamic-parameter-plugin. However, after users requested to be able to define the key:value's of some HTML elements (like `<SELECT>` elements), we migrated the underlying data structure that holds parameter values in the UI to a `java.util.Map`.\r\n\r\nThis part of the code didn't change since the initial code:\r\n\r\n```\r\nfirstElement = choices.get(0);\r\n```\r\n\r\nInterestingly, it works correctly for java.util.List, but returns null for java.util.Map for our parameters. I've used the correct way to retrieve the first element, though I didn't make much validations, since I'm assuming the element will be there and it will be non-null. \r\n\r\nLet me know if you spot any issue that could be related to this change. Thankfully I think we'll be able to ship this issue with 1.0 :-)\r\n\r\nThanks for reporting the issue and for the patience to all involved. \r\nBruno"}}