Hello Jira team,
When a user selects some option from drop-down list I want to appear it into comment field.
Example:
Drop-down list with 5 options:
- Contractor "John"
- Contractor "Emily"
- Contractor "Mark"
- Contractor "Russel"
- Contractor "Sally"
A user selects "Contractor "Emily" from drop-down, comment fields updates and "Contractor "Emily" record appears into the field.
Is there any plug-in or script?
Please guys I need a help.
I found solution using Jython script. Here is:
from com.atlassian.jira.util import ImportUtils
from com.atlassian.jira.issue import MutableIssue
from com.atlassian.jira.component import ComponentAccessor
from com.atlassian.jira.issue.fields import CustomField
from com.atlassian.jira.issue.comments import CommentManager
issueManager = ComponentAccessor.getIssueManager()
issueFactory = ComponentAccessor.getIssueFactory()
user = issue.getAssignee()
ComponentAccessor = ComponentAccessor()
JiraAuthenticationContext = ComponentAccessor.getJiraAuthenticationContext()
LoggedUser = JiraAuthenticationContext.getLoggedInUser()
userManager = ComponentAccessor.getUserManager()
customFieldManager = ComponentAccessor.getCustomFieldManager()
fldID = 'customfield_XXXXX'
#put your custom field number instead of XXXXX
fldFieldValue = issue.getCustomFieldValue(customFieldManager.getCustomFieldObject(fldID)).getName()
comment = "Selected contractor is: " + fldFieldValue
CommentManager = ComponentAccessor.getCommentManager()
CommentManager.create(issue, LoggedUser, comment, True)
#Update search indexes
ImportUtils.setIndexIssues(True)
ImportUtils.setIndexIssues(False)
You will need some form of automation or scripting addon for this. A “listener”will have to listen for changes in that field and when modified a comment added. Here is a older thread that provides a good groovy script for similar question - Add-new-comment-with-new-field-value-when-field-is-updated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An addon would ideal instead of scripting :) Unfortunately I didn't find any one. I found this similar solution https://confluence.cprime.io/display/TR/Show+custom+message+field+based+on+select+list+value, but it looks like inconvenient to use it if I have five and more options (20+ options).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look at Automation for Jira. One of my favorite apps. It is now included in Cloud but not (yet) in Server.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.