It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Script runner - access fields from Profields plugin


Is it possible to accessProfields plugin's values through ScriptRunner?

For.e.g. I'd like to get profields values from custom REST endpoint.

When I am importing profields classes, it shows me an error

"Unable to resolve class com.deiser.jira........" (see attached screenshot)


script runner and profields.png

Thank you in advance!


2 answers

1 accepted

0 votes
Answer accepted

Hi Fyodor,

It's a pleasure to hear from you again :)

You can find the solution in this post:

In this case, the code gets the value of the status field in a project:

import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.deiser.jira.profields.api.field.FieldService
import com.deiser.jira.profields.api.value.ValueService
import com.deiser.jira.profields.api.field.status.StatusField
import com.atlassian.jira.issue.Issue


Issue issue = ComponentAccessor.issueManager.getIssueByCurrentKey("SCRUM-7")

def valueService = ComponentAccessor.getOSGiComponentInstanceOfType(ValueService.class)
def fieldService = ComponentAccessor.getOSGiComponentInstanceOfType(FieldService.class)

def statusField = fieldService.get(9) //ID of field Status

return valueService.getValue(issue.projectObject,(StatusField) statusField)


You can find all the API info of versión 5.5.4:



Hello Adrian

Thank you for advice.



Hi Adrian,

I am using prifields api in one of my custom JIRA plugin.

I have implemented in a similar fashion as per your post bet getting below Error.

valueService.getValue(issue.projectObject,(StatusField) statusField)

 Error Log :


not found by [276]

at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(

at org.apache.felix.framework.BundleWiringImpl.access$400(

at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(

at java.lang.ClassLoader.loadClass(


Hi @Kiranped,


What version of Profields plugin do you have installed?




Profields 5.3.0 and jira 7.6.0

Hi @Kiranped,


Can you update Profields plugin to the last version and do the same test?




@Adrián Plaza _DEISER_,


I have tried with 5.6.3 version and JIRA 7.6 version. I am facing the same problem.

Profield Type: Select List (single choice)

I am using ListField


private Field getPartnerVisibleProField(){

List<Field> fields = fieldService.get();

for (Field field : fields){

if ("Field_Name".equals(field.getName())){

return field;


return null;


valueService.getValue(issue.projectObject,(ListField) getPartnerVisibleProField()) // 



*********************************StatusField case******************************

if I typecast to (StatusField)getPartnerVisibleProField(), getting null object but I have a value updated

Muy buenas Adrian,

Estoy evaluando el plugin y necesito saber si puedo cambiar un campo de tipo status en una postfuntion de script runner.

Por ejemplo:

Al ejecutar un bloqueo de una tarea que el campo status del proyecto cambie a bloqueado. ¿tienes un ejemplo para orientarme?


Un saludo.

I am evaluating the plugin and I need to know if I can change a field of type status in a postfuntion of script runner. For example: When executing a block of a task, the status field of the project changes to blocked. Do you have an example to guide me? A greeting.

@fjodors - Is this issue resolved. I am also facing the same issue.


Yes, you need to add @WithPlugin("com.deiser.jira.profields") command, then you can use profields methods and classes.

See related issues

Hey, I have done this through REST End Point and it is working. But while I am executing same script via custom script applied on post function of the jira workflow. It shows the error.

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you