settings - JIRA Email Notification when log time worked is reaching budget time. OnDemand -


i know if there option send notification when log time worked reaching estimating time.

example: start.

estimated: original estimate - 5 minutes 5m

remaining: remaining estimate - 5 minutes 5m

logged: time spent - not specified not specified

when log time.

estimated: original estimate - 5 minutes 5m

remaining: time spent - 4 minutes remaining estimate - 1 minute 1m

logged: time spent - 4 minutes remaining estimate - 1 minute 4m

i jira send notification before 1 minute ending or ever set.

i'm sorry bad english.

thank you

i believe wanted create kind of triggered event when logged work approaches original estimate, not know how in jira. nevertheless, know still might solve problem.

try using following groovy script:

import com.atlassian.jira.componentmanager import com.atlassian.jira.component.componentaccessor import com.atlassian.jira.config.properties.apkeys import com.atlassian.jira.config.properties.applicationproperties import com.atlassian.jira.issue.issue import com.atlassian.jira.issue.search.searchresults import com.atlassian.jira.issue.worklog.worklog import com.atlassian.jira.jql.parser.defaultjqlqueryparser import com.atlassian.jira.web.bean.pagerfilter import com.atlassian.mail.email import com.atlassian.mail.mailexception import com.atlassian.mail.mailfactory import com.atlassian.mail.queue.singlemailqueueitem import com.atlassian.query.query import groovy.text.gstringtemplateengine import org.apache.log4j.logger import com.atlassian.core.util.dateutils  def componentmanager = componentmanager.getinstance() def worklogmanager = componentmanager.getworklogmanager() def userutil = componentmanager.getuserutil() def user = userutil.getuser('admin') def searchprovider = componentmanager.getsearchprovider() def queryparser = new defaultjqlqueryparser() logger log = logger.getlogger('worklognotification')  query jql = queryparser.parsequery('project = abc , updated > startofday(-1d)') searchresults results = searchprovider.search(jql, user, pagerfilter.getunlimitedfilter()) list issues = results.getissues() string emailformat = 'html' def mailservermanager = componentmanager.getmailservermanager() def mailserver = mailservermanager.getdefaultsmtpmailserver() string defaultsubject = 'logged work on jira issue %issue% exceeds original estimate' string body = '' map binding = [:] string loggedworkdiff = '' string template = ''' dear ${issue.assignee.displayname}, <br /><br />  logged work on issue <a href="$baseurl/browse/${issue.key}">${issue.key} (${issue.summary})</a> exceeds original estimate ($loggedworkdiff more expected).<br />  *** automatically generated email, not need reply ***<br /> ''' gstringtemplateengine engine = new gstringtemplateengine()  applicationproperties applicationproperties = componentmanager.getapplicationproperties() binding.put("baseurl", applicationproperties.getstring(apkeys.jira_baseurl))  if (mailserver && ! mailfactory.issendingdisabled()) {     (issue issue in issues) {         if(issue.originalestimate) {             loggedwork = 0             worklogs = worklogmanager.getbyissue(issue)             worklogs.each{worklog worklog -> loggedwork += worklog.gettimespent()}             if(loggedwork - issue.originalestimate) {                 loggedworkdiff = dateutils.getdurationstring(math.round(loggedwork - issue.originalestimate))                 email = new email(issue.getassigneeuser().getemailaddress())                 email.setfrom(mailserver.getdefaultfrom())                 email.setsubject(defaultsubject.replace('%issue%', issue.getkey()))                 email.setmimetype(emailformat == "html" ? "text/html" : "text/plain")                 binding.put("issue", issue)                 binding.put('loggedworkdiff', loggedworkdiff)                  body = engine.createtemplate(template).make(binding).tostring()                 email.setbody(body)                 try {                     log.debug ("sending mail ${email.getto()}")                     log.debug ("with body ${email.getbody()}")                     log.debug ("from template ${template}")                     singlemailqueueitem item = new singlemailqueueitem(email);                     componentaccessor.getmailqueue().additem(item);                 }                 catch (mailexception e) {                     log.warn ("error sending email", e)                 }             }         }     } } 

this script takes issues project abc, have been updated during previous day (jql: "project = abc , updated > startofday(-1d)"), calculates difference between logged work , estimated work , sends notification issue assignee if logged work exceeds original estimate.

you can add script list of jira services (jira -> administration -> system -> advanced -> services).

name: [any name]

class: com.onresolve.jira.groovy.groovyservice

delay: 1440

input file: [path script on server]

delay: 1440

note put 1440 (min) service delay, equals 1 day. so, script executed once per day sending notification issue assignees exceeded original estimates.

also note groovy scripting plugin should installed in order able run script.


Comments

Popular posts from this blog

java - Cast from Object to List<String>: CastClassException -

How to set a border for android Imageview in Longpress? -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -