Update problem Assignee

Dieter Scheruga June 23, 2015

Hi,

I'm setting assignee in a script runner post function via

issueService.assign(user, assignResult) ....

I see this assignee in the issue. But in the issue navigator it still shows unassigned.

If I update the issue (f.e. update the description) or reindex the issue manually , the assignee is also show in the issue navigator.

Extra funny: I'm using the script in 2 projects. In first project I don't have the update problem.

I've also tried to reindex in the post function => no effect for the 2 nd project.

 

boolean wasIndexing = ImportUtils.isIndexIssues();
IssueManager issueManager = ComponentAccessor.getIssueManager();
        ComponentAccessor.getIssueIndexManager().reIndex(executionResult.getIssue());
ImportUtils.setIndexIssues(wasIndexing);

     

What could be the reason. Bug in JIRA or ???

What could the issueService.assign() forget ot trigger ?

Thanks

Dieter

1 answer

0 votes
Tsol
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.
June 23, 2015

Hi there,

Your projects use the same workflow?

If not, check the order of post functions on the one you get the right result and copy it to the one you have the problem.

Dieter Scheruga June 23, 2015

Yes the workflow is similar and should be ok. Post function is before index in worfklow => should be ok. But I found out the diferrence between the other project. The working project has an additional StateListener (Scriptrunner) setting some date values. So the issue is updated again => and this "solves" the update for the assignee (lucky strike). So the real problem is that the issueService.assing() has some refesh problem ??? Any idea therefore?

Tsol
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.
June 23, 2015

Why don't you use issue.assigneeId = "username" in your scripts?

Dieter Scheruga June 23, 2015

doesn't help I don't think this would be stored anyway.

Dieter Scheruga June 23, 2015

sorry you are right. I made a copy mistake so issue.assigneeId = "username" seems to work thanks

Dieter Scheruga June 23, 2015

But then you don't find this issue if you search FYI project = XY and assignee = Testuser This issue is then NOT in the result list. If you update the issue => it's in the result list. So again an refresh problem

JamieA
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.
June 23, 2015

So long as your function is "first", you should be fine with issue.assigneeId = ... I would not use issueService for this, it will create a new history change group.

Dieter Scheruga June 23, 2015

My init script can't be first (before create issue) because in front there's an email parser that creates the issue and my script cames afterwards. @Jamie: Do you have any idea for this refresh problem? There should be a reason. Thxs

Dieter Scheruga June 23, 2015

@Jamie Echlin : Do you have any idea for this refresh problem? There should be a reason.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events