how can i get completed task, available task,assigned task name using username only
You can use Bonita Engine REST API to do so. The easiest way to spot the API to call is to use the web developer tools of your web browser and take a look at the requests sent when using Bonita Portal. Of course I also recommend to read REST API documentation.
For example here is the call to get the list of task a user can do:
The list of task assigned to the user:
is it possible to get available task of particular user using role id?