Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Post function to remove the story points

kondaparthy sumanth April 5, 2018

Hi

When a story is moved to done and resolution is NOT fixed , i want a post function that removes story points from story .

Hope for reply

2 answers

0 votes
Max Foerster - K15t
Community Champion
April 5, 2018

Hi Kondaparthy,

you could also use a post function provided by another app on the marketplace called Jira Workflow Toolbox developed by us (e.g. "Copy parsed text to a field" or "Set field as function of other fields") to set the field to null with a conditional execution using a boolean expression like resolution != fixed. May be easier than scripting :D

Best, Max

0 votes
Alexey Matveev
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 5, 2018

If you have such plugins as Power Script or ScriptRunner, you could develop such post function.

kondaparthy sumanth April 5, 2018

Hi Alexey,

Please can you give me in detail to develop such post function in script runner 

Alexey Matveev
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 5, 2018

Go to the required workflow, choose add post function, then choose Script PostFunction, then Custom Script Function and write something like this

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def storyPointsCS = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Story Points")
issue.setCustomFieldValue(storyPointsCS, null)
ComponentAccessor.getIssueManager().updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, false)
Ravinder Reddy Singireddy April 5, 2018

Hi Alexy,

I tried using the script but the script is directly deleting the story points.

I also tried to put a condition comparing the Resolution and then deleting the story points depending on the condition. But was unsuccessful

Could you please help me with the script having a condition as If resolution is not Done then the story points should be deleted.

Thanks in Advance. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events