Forums

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

how can we update the standard field in jira using script runner ?

satya sandeep March 3, 2022

 actually we have tired with custom fields and it got successfully updating but now my challenge is  that I need to update the standard fields like Priority, description and summary like that and I just need to know how we can achieve this using script runner .

 

Here I'm sharing my custom filed value code so  in that how we can update the standard field values and how we can updated that in issues.

 

please help me in that code to write the standard fields value or any other alternative way 

 

 

 code for custom  field value update:

 

import com.atlassian.jira.issue.IssueManager

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


 def customfield=ComponentAccessor.getCustomFieldManager().getCustomFieldObject('customfield_10113')
 def issue= ComponentAccessor.getIssueManager().getIssueByCurrentKey('JD-5')
 def value=issue.getCustomFieldValue(customfield)



def changeHolder =new DefaultIssueChangeHolder()
customfield.updateValue(null, issue, new ModifiedValue(value, "checking the update value successfully"),changeHolder)
   

1 answer

0 votes
Sebastian Krzewiński
Community Champion
March 3, 2022

Hi @satya sandeep 

 

To set summary - issue.setSummary("XYZ")

To set description - issue.setDescription("text")

To set priority - issue.setPriorityId(priority_id)

 

Regards,

Seba

satya sandeep March 3, 2022

In which issue it will create if we updated that in jira script runner and how we can add these to some jira issue and can u help me in that please.

Sebastian Krzewiński
Community Champion
March 3, 2022

I don't understand what you want to achieve. Can you explain it more?

Suggest an answer

Log in or Sign up to answer