Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Make annotations visible in workflow (for users of the issue)

Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2013

Is somehow possible to make workflow annotations visible in workflow for users of the issue (in picture after choosing View Workflow link near status field)?

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2013

Now we use Script Field (by Script Runner plugin) with:
- detailed information about each step and
- link to picture with workflow (with included annotations)
as a workaround. That's enough for us.

Script how to display information what to do in current step in an issue:
(code is written with Groovy)

import com.atlassian.core.ofbiz.util.OFBizPropertyUtils
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.config.ConstantsManager
import org.ofbiz.core.entity.GenericValue
import com.opensymphony.module.propertyset.PropertySetManager
import com.opensymphony.workflow.loader.StepDescriptor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.workflow.WorkflowManager
import com.atlassian.jira.workflow.JiraWorkflow
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.util.IssueChangeHolder
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
ComponentManager componentManager = ComponentManager.getInstance()
ConstantsManager constantsManager = componentManager.getConstantsManager()

// String for property with name description. It is used for description of the current step.
def String propertyName = "description"
// String for property with name responsible. It is used to present who/ which role is responsible for current step.
def String propertyName2 = "responsible"
// Define the string which will contain final value for the Script field
def String result = ""

MutableIssue myIssue = issue
GenericValue gv = constantsManager.getStatusByName(myIssue.getStatusObject().getName()).getGenericValue()
Map ofbizArgs = [
"delegator.name" : "default",
"entityName" : "IssueStatus",
"entityId" : gv.get("id") as Long,
]
PropertySetManager.getInstance("ofbiz", ofbizArgs, OFBizPropertyUtils.class.getClassLoader())
WorkflowManager workflowManager = componentManager.getWorkflowManager()
JiraWorkflow workflow = workflowManager.getWorkflow(myIssue)
StepDescriptor step = workflow.getLinkedStep(gv)
def fdescription = step.getProperties()?.get("metaAttributes")?.get(propertyName)
def fresponsible = step.getProperties()?.get("metaAttributes")?.get(propertyName2)

//it is not possible? to have tags in steps properties so we substitute tags for special words in step descriptions
result =(fdescription =~ /brxx/).replaceAll("<br>")
result =(result =~ /sxx/).replaceAll("<strong>")
result =(result =~ /syy/).replaceAll("</strong>")

return "<div class=\'infoBox\'>" + result + "<br> <strong>Responsible:</strong> " + fresponsible + "<br> <strong>More info: </strong> your url for the documentation"+ "</div>"

1 vote
Chaithra N
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2013

hi,

Are you looking at some sort of help full descriptions for your Workflow actions?

If Yes, then when ever you add / edit the transitions, you can give description for each tranistions.

And this description will be displayed on mouse over on the Issue Worflow tranitions.

Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2013

We’d like to have general overview of the workflow with emphasised most important information (annotations, notes where is necessary to enter essential information or be careful, who responsibilities in some steps …).

Your proposal is not exactly what I need but it is still a possible workaround.

I also prepared Script Field (by Script Runner plugin) with detailed information about each step and link to picture with workflow (with included annotations) in meantime as a workaround.

Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2013

Procedure for my current workaround using Script Field (in Script Runner plugin) with detailed information about each step and link to documentation:

1. Add description for each step in workflow:
- Move the mouse pointer over the relevant step and click the cog icon that appears to the right of the step to reveal a popup menu.
- From the popup menu, select Step Properties.
- In Property Key field insert name of the property: description.
- In Property Value enter the description of the field (e.g. Description - Paragraph 1 brxx Paragraph 2 brxx sxx text syy 2…)

2. Create custom field of field type Scripted Field and relate it with view screen of the project

3. Prepare code for Script Field.

Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2013

Code:
import com.atlassian.core.ofbiz.util.OFBizPropertyUtils

import com.atlassian.jira.ComponentManager

import com.atlassian.jira.config.ConstantsManager

import org.ofbiz.core.entity.GenericValue

import com.opensymphony.module.propertyset.PropertySetManager

import com.opensymphony.workflow.loader.StepDescriptor

import com.atlassian.jira.issue.MutableIssue

import com.atlassian.jira.workflow.WorkflowManager

import com.atlassian.jira.workflow.JiraWorkflow

import com.atlassian.jira.issue.fields.CustomField

import com.atlassian.jira.issue.util.IssueChangeHolder

import com.atlassian.jira.issue.util.DefaultIssueChangeHolder

import com.atlassian.jira.issue.ModifiedValue

ComponentManager componentManager = ComponentManager.getInstance()

ConstantsManager constantsManager = componentManager.getConstantsManager()

def String propertyName = "description"

def String propertyName2 = "responsible"

MutableIssue myIssue = issue

GenericValue gv = constantsManager.getStatusByName(myIssue.getStatusObject().getName()).getGenericValue()

Map ofbizArgs = [

"delegator.name" : "default",

"entityName" : "IssueStatus",

"entityId" : gv.get("id") as Long,

]

PropertySetManager.getInstance("ofbiz", ofbizArgs, OFBizPropertyUtils.class.getClassLoader())

WorkflowManager workflowManager = componentManager.getWorkflowManager()

JiraWorkflow workflow = workflowManager.getWorkflow(myIssue)

StepDescriptor step = workflow.getLinkedStep(gv)

def fdescription = step.getProperties()?.get("metaAttributes")?.get(propertyName)

def fresponsible = step.getProperties()?.get("metaAttributes")?.get(propertyName2)

def i = 0

def String result = ""

result =(fdescription =~ /brxx/).replaceAll("<br>")

result =(result =~ /sxx/).replaceAll("<strong>")

result =(result =~ /syy/).replaceAll("</strong>")

return "<div class=\'infoBox\'>" + result + "<br> <strong>Responsible:</strong> " + fresponsible + "<br> <strong>More info: </strong> url with link"+ "</div>"

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2013

Vidic, any chance of posting the code for the scripted field?

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2013

Cool thanks. I think it's important to document the workflow as much as possible within the tool.

If possible, could you edit your comment, and use the code thing, and select groovy - it will look much better. At the moment it seems like you can't edit other peoples comments.

Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2013

I have a lot of problems to edit/create new comment (it is not possible to edit comment, preview didn't work, maximum size of the comment is 2000 characters ...) so I add code as an answer.

It looks better now :-)

0 votes
Vidic Florjan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2013

Now we use Script Field (by Script Runner plugin) with:
- detailed information about each step and
- link to picture with workflow (with included annotations)
as a workaround. That's enough for us.

Script how to display information what to do in current step in an issue:
(code is written with Groovy)

import com.atlassian.core.ofbiz.util.OFBizPropertyUtils
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.config.ConstantsManager
import org.ofbiz.core.entity.GenericValue
import com.opensymphony.module.propertyset.PropertySetManager
import com.opensymphony.workflow.loader.StepDescriptor
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.workflow.WorkflowManager
import com.atlassian.jira.workflow.JiraWorkflow
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.util.IssueChangeHolder
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.issue.ModifiedValue
ComponentManager componentManager = ComponentManager.getInstance()
ConstantsManager constantsManager = componentManager.getConstantsManager()

// String for property with name description. It is used for description of the current step.
def String propertyName = "description"
// String for property with name responsible. It is used to present who/ which role is responsible for current step.
def String propertyName2 = "responsible"
// Define the string which will contain final value for the Script field
def String result = ""

MutableIssue myIssue = issue
GenericValue gv = constantsManager.getStatusByName(myIssue.getStatusObject().getName()).getGenericValue()
Map ofbizArgs = [
"delegator.name" : "default",
"entityName" : "IssueStatus",
"entityId" : gv.get("id") as Long,
]
PropertySetManager.getInstance("ofbiz", ofbizArgs, OFBizPropertyUtils.class.getClassLoader())
WorkflowManager workflowManager = componentManager.getWorkflowManager()
JiraWorkflow workflow = workflowManager.getWorkflow(myIssue)
StepDescriptor step = workflow.getLinkedStep(gv)
def fdescription = step.getProperties()?.get("metaAttributes")?.get(propertyName)
def fresponsible = step.getProperties()?.get("metaAttributes")?.get(propertyName2)

//it is not possible? to have tags in steps properties so we substitute tags for special words in step descriptions
result =(fdescription =~ /brxx/).replaceAll("&lt;br&gt;")
result =(result =~ /sxx/).replaceAll("&lt;strong&gt;")
result =(result =~ /syy/).replaceAll("&lt;/strong&gt;")

return "&lt;div class=\'infoBox\'&gt;" + result + "&lt;br&gt; &lt;strong&gt;Responsible:&lt;/strong&gt; " + fresponsible + "&lt;br&gt; &lt;strong&gt;More info: &lt;/strong&gt; your url for the documentation"+ "&lt;/div&gt;"

TAGS
AUG Leaders

Atlassian Community Events