Field Script Runner: 'issueFunction' does not exist or this field cannot be viewed by anonymous users."

I am facing this issue as well. As suggested I have made sure the scheme context is set to Global mode.

It didn't solve my issue and keep getting the same error. By the way I am using JIRA rest API services with curl.

The exact error is, "Field 'issueFunction' does not exist or this field cannot be viewed by anonymous users."

The JIRA project is open to all and hence anybody can view all the issues inside this project. Also I am able to access all the issue fields anonymously without any issue. It is only when I use this script runner's 'issueFunction' throwing the authentication issue.

 

Any help is really appreciated.

2 answers

1 vote

issueFunction is not a field, it's a JQL function in script runner.  Could you show us the JQL you are using it in?   Is the Scriptrunnner fully enabled, and is the scripted-functions module enabled?

Thanks Nic for your reply. This is the command I am using,

curl -D- -H 'content-type:application/json' -X POST -d '{"jql":"issueFunction in issueFieldMatch(\"project=FOO\",\"Version Found\",\"13.2_\")","fields":["summary","status","assignee"]}' http://XXX/rest/api/2/search

{"errorMessages":["Field 'issueFunction' does not exist or this field cannot be viewed by anonymous users."],"errors":{}}

I didn't get when you meant 'fully enabled'. I think the Script Runner plugin is enabled as I see the 'issueFunction'  shown in my list of custom fields.

In the 'Script JQL Functions' page I see a list of functions that said are enabled and the function I have used in this example 'issueFieldMatch' is among them.

 

What happens when you run identical JQL in the UI?

I get the results without any issue.

Ok, then that suggests that you are logging in as a different user under REST and that user is not able to view the project.

No for REST I am running anonymously and that is evident from my curl command above.

People often drop the username/password when posting here for security reasons, or you could have been using cookies. Anyway, that's the answer - you need to log in as a user who can see the project

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

344 views 0 1
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you