不需要产品经理分流版
来源:互联网 发布:php发送qq邮件源码 编辑:程序博客网 时间:2024/04/28 10:10
def project_workflow_21
sleep 2
result ={}
options={:expand => "transitions"}
issue = @jira_client.Issue.find(params["issue.key"], options) #获得所有的jira字段信息
project_type = issue.attrs["fields"]["issuetype"]["id"] #获取问题类型
copy_data=issue.attrs["fields"]["customfield_10118"]
copy_data_total=[]
options_user=issue.attrs["fields"]["reporter"]["name"]+"&expand=groups"
user=@jira_client.User.find(options_user)
departments_arr= user.groups["items"]
is_customer = false
departments_arr.each do |u|
if u["name"]=="市场部" or u["name"]=="客服部" or u["name"]=="客服部-400" or u["name"]=="客服部-2楼" or u["name"]=="客服审核组"
is_customer=true
end
end
if copy_data.to_s!=""
copy_data.each do |u|
tmp_hash = Hash.new
tmp_hash["name"]=u["name"]
tmp_hash["key"]=u["key"]
copy_data_total<<tmp_hash
end
end
if (is_customer and project_type=="10623") #客服提的问题类型为:国内(10623)、海外萤石云(10624)时,经办人设置为陈兴旺,判断判断客户端类型是否选择了“安卓客户端”、“IOS客户端”,若是抄送给邓世华
transition_data = {"name" => "chenxingwang", "key" => "chenxingwang"}
issue.theurl=issue.url + "/assignee"
issue.set_http_method="put"
logger.info("[project_workflow_21] : " +"经办人设置成功"+ issue.save(transition_data).to_s)
else
issue = @jira_client.Issue.find(params["issue.key"], options)
issue.transitions.each do |transition|
logger.info('[project_workflow_21] :'+transition.to_s)
if transition.attrs["name"] == "是问题"
transition_data = {
:transition => transition.attrs,
"fields" => {"customfield_11332" => {"name" => issue.attrs["fields"]["assignee"]["name"], "key" => issue.attrs["fields"]["assignee"]["key"]}}
}
transition.save(transition_data)
end
end
end
if issue.attrs["fields"]["customfield_11078"].to_s.include? "安卓客户端" or issue.attrs["fields"]["customfield_11078"].to_s.include? "IOS客户端"
copy_data_new_dengshihua=[{"name" => "dengshihua", "key" => "dengshihua"}]
copy_data_total= copy_data_total|copy_data_new_dengshihua
end
if project_type=="10623" or project_type=="10624"
copy_data_new_zhangxin=[{"name" => "zhangxinyf2", "key" => "zhangxinyf2"}]
copy_data_total= copy_data_total|copy_data_new_zhangxin
copy_data = {
"fields" => {
"customfield_10118" => copy_data_total
}
}
logger.info('[project_workflow_21] :'+"抄送给"+issue.save(copy_data).to_s)
end
logger.info('[project_workflow_21] :'+"函数结束")
result['msg'] = 'project_workflow_21 return success!'
render :text => result.to_json, :layout => false
end
sleep 2
result ={}
options={:expand => "transitions"}
issue = @jira_client.Issue.find(params["issue.key"], options) #获得所有的jira字段信息
project_type = issue.attrs["fields"]["issuetype"]["id"] #获取问题类型
copy_data=issue.attrs["fields"]["customfield_10118"]
copy_data_total=[]
options_user=issue.attrs["fields"]["reporter"]["name"]+"&expand=groups"
user=@jira_client.User.find(options_user)
departments_arr= user.groups["items"]
is_customer = false
departments_arr.each do |u|
if u["name"]=="市场部" or u["name"]=="客服部" or u["name"]=="客服部-400" or u["name"]=="客服部-2楼" or u["name"]=="客服审核组"
is_customer=true
end
end
if copy_data.to_s!=""
copy_data.each do |u|
tmp_hash = Hash.new
tmp_hash["name"]=u["name"]
tmp_hash["key"]=u["key"]
copy_data_total<<tmp_hash
end
end
if (is_customer and project_type=="10623") #客服提的问题类型为:国内(10623)、海外萤石云(10624)时,经办人设置为陈兴旺,判断判断客户端类型是否选择了“安卓客户端”、“IOS客户端”,若是抄送给邓世华
transition_data = {"name" => "chenxingwang", "key" => "chenxingwang"}
issue.theurl=issue.url + "/assignee"
issue.set_http_method="put"
logger.info("[project_workflow_21] : " +"经办人设置成功"+ issue.save(transition_data).to_s)
else
issue = @jira_client.Issue.find(params["issue.key"], options)
issue.transitions.each do |transition|
logger.info('[project_workflow_21] :'+transition.to_s)
if transition.attrs["name"] == "是问题"
transition_data = {
:transition => transition.attrs,
"fields" => {"customfield_11332" => {"name" => issue.attrs["fields"]["assignee"]["name"], "key" => issue.attrs["fields"]["assignee"]["key"]}}
}
transition.save(transition_data)
end
end
end
if issue.attrs["fields"]["customfield_11078"].to_s.include? "安卓客户端" or issue.attrs["fields"]["customfield_11078"].to_s.include? "IOS客户端"
copy_data_new_dengshihua=[{"name" => "dengshihua", "key" => "dengshihua"}]
copy_data_total= copy_data_total|copy_data_new_dengshihua
end
if project_type=="10623" or project_type=="10624"
copy_data_new_zhangxin=[{"name" => "zhangxinyf2", "key" => "zhangxinyf2"}]
copy_data_total= copy_data_total|copy_data_new_zhangxin
copy_data = {
"fields" => {
"customfield_10118" => copy_data_total
}
}
logger.info('[project_workflow_21] :'+"抄送给"+issue.save(copy_data).to_s)
end
logger.info('[project_workflow_21] :'+"函数结束")
result['msg'] = 'project_workflow_21 return success!'
render :text => result.to_json, :layout => false
end
0 0
- 不需要产品经理分流版
- project_workflow_21产品经理分流版
- 初创公司需不需要产品经理?
- 产品&经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 产品经理
- 关于几种语言(c#,php,python,javascript)字符串的gzip压缩与解压的整理
- Uva536 Tree Recovery 【递归建树】【习题6-3】
- 《或者你需要一场轰轰烈烈的爱情-雾满拦江》
- html5摇一摇代码
- 浏览器同源政策及其规避方法
- 不需要产品经理分流版
- Android LruCache 源码分析
- cocos2d 中 scene(), create(), init() 调用关系
- BZOJ 1012 最大数maxnumber 单调队列或线段树
- Windows Server 2012 r2优化
- leetcode-169-Major Element
- 在阿里云服务器上快速搭建JavaWeb环境(安装JDK、Tomcat、MySQL)+Intellij IDEA远程部署调试tomcat
- 启动模式要点
- iOS制作支持通用cpu指令集的framework