My class version is 40.0 .
i have created trigger on task object when task is open its post on chatter and tag a user but the error is Error: Compile Error: Method was removed after version 31.0: postFeedItem
ConnectApi.ChatterFeeds.postFeedItem(null, ConnectApi.FeedType.UserProfile, tery.userId, input, null);