I'd like to specify an issue's "Status" as "Done" on its "Create" transition screen if its "End date" field is filled. I will use this functionality while I'm informing a new issue which had already completed. Can I perform this action by using post functions? I've tried 2 post functions but cannot handle this problem. Its "Status" still seems as "To Do". How can I solve this problem?
Hi @Özge K_ - Welcome to the Atlassian Community!
You can do that with an Automation for Jira rule that would fire on create of the issue.
Then add a condition to check if the End Date is not empty.
And if not, then transition the card to Done.
Hi @John Funk , Thanks for your kind greeting at first !
I've been trying to solve this issue as you declared above. but cannot succeed it.
I don't have an idea about the automation part but I found something useful. I added a post function (Fast-track transition an issue [ScriptRunner]). Here it's screenshot:
and my script is :
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def endDate = customFieldManager.getCustomFieldObjectByName("End Date [Gantt]")
def status = customFieldManager.getCustomFieldObjectByName("Status")
if (issue.getCustomFieldValue(endDate) != null){
issue.setCustomFieldValue(status, "DONE")
}
It still doesn't work. Could you please tell me what my fault is ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I don't use ScriptRunner, so I do not know what would be wrong with the script. :-(
Here is more information about Automation to get you started:
There are two types of automation:
Automation Basics: https://www.atlassian.com/software/jira/guides/expand-jira/automation
You can do this via global rules to apply to all projects also. You'll need to be a Jira Admin/Site Admin, go to Jira Settings > System > Automation Rules (left-hand menu).
For more on using Automation For Jira see these help pages.
Jira Automation Template Library to help get you started quickly:
https://www.atlassian.com/software/jira/automation-template-library#/labels/all/customLabelId/1453
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.