{"action":"created","issue":{"url":"https://api.github.com/repos/Questetra/Addon-XML/issues/1","repository_url":"https://api.github.com/repos/Questetra/Addon-XML","labels_url":"https://api.github.com/repos/Questetra/Addon-XML/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Questetra/Addon-XML/issues/1/comments","events_url":"https://api.github.com/repos/Questetra/Addon-XML/issues/1/events","html_url":"https://github.com/Questetra/Addon-XML/issues/1","id":295512220,"number":1,"title":"指定ユーザが、指定組織のメンバかリーダか判断する Add-on","user":{"login":"hatanaka-akihiro","id":869166,"avatar_url":"https://avatars3.githubusercontent.com/u/869166?v=4","gravatar_id":"","url":"https://api.github.com/users/hatanaka-akihiro","html_url":"https://github.com/hatanaka-akihiro","followers_url":"https://api.github.com/users/hatanaka-akihiro/followers","following_url":"https://api.github.com/users/hatanaka-akihiro/following{/other_user}","gists_url":"https://api.github.com/users/hatanaka-akihiro/gists{/gist_id}","starred_url":"https://api.github.com/users/hatanaka-akihiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hatanaka-akihiro/subscriptions","organizations_url":"https://api.github.com/users/hatanaka-akihiro/orgs","repos_url":"https://api.github.com/users/hatanaka-akihiro/repos","events_url":"https://api.github.com/users/hatanaka-akihiro/events{/privacy}","received_events_url":"https://api.github.com/users/hatanaka-akihiro/received_events","type":"User","site_admin":false},"labels":[{"id":663359744,"url":"https://api.github.com/repos/Questetra/Addon-XML/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"R-Matsubayashi","id":36219261,"avatar_url":"https://avatars2.githubusercontent.com/u/36219261?v=4","gravatar_id":"","url":"https://api.github.com/users/R-Matsubayashi","html_url":"https://github.com/R-Matsubayashi","followers_url":"https://api.github.com/users/R-Matsubayashi/followers","following_url":"https://api.github.com/users/R-Matsubayashi/following{/other_user}","gists_url":"https://api.github.com/users/R-Matsubayashi/gists{/gist_id}","starred_url":"https://api.github.com/users/R-Matsubayashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R-Matsubayashi/subscriptions","organizations_url":"https://api.github.com/users/R-Matsubayashi/orgs","repos_url":"https://api.github.com/users/R-Matsubayashi/repos","events_url":"https://api.github.com/users/R-Matsubayashi/events{/privacy}","received_events_url":"https://api.github.com/users/R-Matsubayashi/received_events","type":"User","site_admin":false},"assignees":[{"login":"R-Matsubayashi","id":36219261,"avatar_url":"https://avatars2.githubusercontent.com/u/36219261?v=4","gravatar_id":"","url":"https://api.github.com/users/R-Matsubayashi","html_url":"https://github.com/R-Matsubayashi","followers_url":"https://api.github.com/users/R-Matsubayashi/followers","following_url":"https://api.github.com/users/R-Matsubayashi/following{/other_user}","gists_url":"https://api.github.com/users/R-Matsubayashi/gists{/gist_id}","starred_url":"https://api.github.com/users/R-Matsubayashi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R-Matsubayashi/subscriptions","organizations_url":"https://api.github.com/users/R-Matsubayashi/orgs","repos_url":"https://api.github.com/users/R-Matsubayashi/repos","events_url":"https://api.github.com/users/R-Matsubayashi/events{/privacy}","received_events_url":"https://api.github.com/users/R-Matsubayashi/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-02-08T13:30:00Z","updated_at":"2018-03-15T01:44:27Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"以下の仕様の Add-on を作成する。\r\n\r\n設定項目\r\n\r\n- I1. 対象ユーザ（ユーザ型データ項目で指定） \r\n- I2. 対象組織（組織型データ項目で指定）\r\n- O1. 結果を保存する文字型データ項目\r\n\r\nI1 が I2 のリーダであれば O1 に \"L\" を、メンバであれば O1 に \"M\" を、所属していなければ O1 に空を設定する。"},"comment":{"url":"https://api.github.com/repos/Questetra/Addon-XML/issues/comments/373232388","html_url":"https://github.com/Questetra/Addon-XML/issues/1#issuecomment-373232388","issue_url":"https://api.github.com/repos/Questetra/Addon-XML/issues/1","id":373232388,"user":{"login":"chica-non","id":26733332,"avatar_url":"https://avatars0.githubusercontent.com/u/26733332?v=4","gravatar_id":"","url":"https://api.github.com/users/chica-non","html_url":"https://github.com/chica-non","followers_url":"https://api.github.com/users/chica-non/followers","following_url":"https://api.github.com/users/chica-non/following{/other_user}","gists_url":"https://api.github.com/users/chica-non/gists{/gist_id}","starred_url":"https://api.github.com/users/chica-non/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chica-non/subscriptions","organizations_url":"https://api.github.com/users/chica-non/orgs","repos_url":"https://api.github.com/users/chica-non/repos","events_url":"https://api.github.com/users/chica-non/events{/privacy}","received_events_url":"https://api.github.com/users/chica-non/received_events","type":"User","site_admin":false},"created_at":"2018-03-15T01:44:27Z","updated_at":"2018-03-15T01:44:27Z","author_association":"COLLABORATOR","body":"テストした時点(3/12 12時半ごろ)では以下にコピーしたものが最新だと思ってテストしたのですが、26行目の ; が抜けてるのと } 括弧が多いみたいで、エラーになったんです。下記を保存しようとすると、「スクリプトに文法エラーがあります。 syntax error (#26)」となっていました。\r\n例えば、https://raw.githubusercontent.com/Questetra/Addon-XML/c4025f687b273177ea4da5a179a3112212c36743/userCheck.xml をアドオンに保存しようとするとエラーが出ると思います。(この場合は「スクリプトに文法エラーがあります。 syntax error (#27)」と出ます。)\r\n今後はリビジョンをチェックしてからテストします。新しいuserCheck.xmlがあるので、そちらでテストします。\r\n---\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<service-task-definition>\r\n\t<label>CheckTheUserIsInTheGroup</label>\r\n\t<label locale=\"ja\">ユーザの指定組織への所属を判定</label>\r\n\t<summary>If the specified user is the leader of the specified group,this task returns \"L\". If the he or she is one of the members of the group,it returns \"M\".If he or she doesn't belong to the group,it returns nothing.</summary>\r\n\t<summary locale=\"ja\">指定したユーザが指定した組織のリーダであれば\"L\" を、メンバであれば\"M\" を、所属していなければ空を返します。</summary>\r\n\t<configs>\r\n\t\t<config name=\"userField\" form-type=\"SELECT\" select-data-type=\"QUSER\" required=\"true\">\r\n\t\t\t<label>I1.User Data</label>\r\n\t\t\t<label locale=\"ja\">I1.ユーザデータ</label>\r\n\t\t</config>\r\n\t\t<config name=\"groupField\" form-type=\"SELECT\" select-data-type=\"QGROUP\" required=\"true\">\r\n\t\t\t<label>I2.Group Data</label>\r\n\t\t\t<label locale=\"ja\">I2.組織データ</label>\r\n\t\t</config>\r\n\t\t<config name=\"result\" form-type=\"SELECT\" select-data-type=\"STRING_TEXTFIELD\" required=\"true\">\r\n\t\t\t<label>O1.Result</label>\r\n\t\t\t<label locale=\"ja\">O1.結果出力先</label>\r\n\t\t</config>\r\n\t</configs>\r\n\t<script><![CDATA[\r\n\t\t  main();\r\n\t\t  function main(){\r\n\t\t  var groupIs = engine.findDataByNumber(configs.get(\"groupField\"));\r\n\t\t  var userIs = engine.findDataByNumber(configs.get(\"userField\"));\r\n\t\t  var result = \"\"\r\n\t\t    if (check(true,userIs,groupIs)) {\r\n\t\t    result = \"L\"\r\n\t\t    }else{\r\n\t\t        if (check(false,userIs,groupIs)) {\r\n\t\t        result = \"M\"\r\n\t\t        }\r\n\t\t    }\r\n\t\t    engine.setDataByNumber(configs.get(\"result\"),result);\r\n\t\t  }\r\n\t\t  function check(LM,user,group){\r\n\t\t    var temp = \"\";\r\n\t\t    var list = quserDao.findByQgroupAndPosition(group,LM);\r\n\t\t    for (var i = 0;i<list.size();i++){\r\n\t\t      temp = list.get(i);\r\n\t\t      if(user.getId().equals(temp.getId())){\r\n\t\t        return true;\r\n\t\t      }\r\n\t\t    }\r\n\t\t  }\r\n}\r\n]]>\r\n</script>\r\n</service-task-definition>\r\n---"}}
{"actor":{"display_login":"chica-non"}}